Merge "CredentialsV3: Ensure all attributes are cleared by unset"
This commit is contained in:
commit
ad47bad388
@ -45,10 +45,10 @@ class Puppet::Provider::Openstack::Credentials
|
||||
end
|
||||
|
||||
def unset
|
||||
KEYS.each do |key|
|
||||
if key != :identity_api_version &&
|
||||
self.instance_variable_defined?("@#{key}")
|
||||
set(key, '')
|
||||
self.instance_variables.each do |var|
|
||||
if var.to_s != '@identity_api_version' &&
|
||||
self.instance_variable_defined?(var.to_s)
|
||||
set(var.to_s.sub(/^@/,''), '')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -86,6 +86,7 @@ describe Puppet::Provider::Openstack::Credentials do
|
||||
creds.auth_url = 'auth_url'
|
||||
creds.password = 'password'
|
||||
creds.project_name = 'project_name'
|
||||
creds.domain_name = 'domain_name'
|
||||
creds.username = 'username'
|
||||
creds.token = 'token'
|
||||
creds.endpoint = 'endpoint'
|
||||
@ -94,6 +95,7 @@ describe Puppet::Provider::Openstack::Credentials do
|
||||
expect(creds.auth_url).to eq('')
|
||||
expect(creds.password).to eq('')
|
||||
expect(creds.project_name).to eq('')
|
||||
expect(creds.domain_name).to eq('')
|
||||
expect(creds.username).to eq('')
|
||||
expect(creds.token).to eq('')
|
||||
expect(creds.endpoint).to eq('')
|
||||
|
Loading…
Reference in New Issue
Block a user