Commit 55959343 authored by Ash McKenzie's avatar Ash McKenzie

Extract credential logic to #default_credentials

parent bf577806
......@@ -37,13 +37,7 @@ module QA
end
def use_default_credentials
if ::QA::Runtime::User.ldap_user?
self.username = Runtime::User.ldap_username
self.password = Runtime::User.ldap_password
else
self.username = Runtime::User.username
self.password = Runtime::User.password
end
self.username, self.password = default_credentials
add_credentials_to_netrc unless ssh_key_set?
end
......@@ -138,6 +132,14 @@ module QA
output
end
def default_credentials
if ::QA::Runtime::User.ldap_user?
[Runtime::User.ldap_username, Runtime::User.ldap_password]
else
[Runtime::User.username, Runtime::User.password]
end
end
def tmp_netrc_directory
@tmp_netrc_directory ||= File.join(Dir.tmpdir, "qa-netrc-credentials", $$.to_s)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment