Merge "keystone_user: Remove redundant domain parameter input check"

This commit is contained in:
Zuul 2024-09-16 15:31:35 +00:00 committed by Gerrit Code Review
commit f82997113c
2 changed files with 5 additions and 11 deletions

View File

@ -35,11 +35,9 @@ Puppet::Type.type(:keystone_tenant).provide(
properties << '--disable'
end
if resource[:description]
properties << '--description'
properties << resource[:description]
properties << '--description' << resource[:description]
end
properties << '--domain'
properties << resource[:domain]
properties << '--domain' << resource[:domain]
@property_hash = self.class.system_request('project', 'create', properties)
@property_hash[:name] = resource[:name]

View File

@ -28,8 +28,7 @@ Puppet::Type.type(:keystone_user).provide(
if self.class.do_not_manage
fail("Not managing Keystone_user[#{@resource[:name]}] due to earlier Keystone API failures.")
end
user_name, user_domain = resource[:name], resource[:domain]
properties = [user_name]
properties = [resource[:name]]
if resource[:enabled] == :true
properties << '--enable'
elsif resource[:enabled] == :false
@ -44,13 +43,10 @@ Puppet::Type.type(:keystone_user).provide(
if resource[:email]
properties << '--email' << resource[:email]
end
if user_domain
properties << '--domain'
properties << user_domain
end
properties << '--domain' << resource[:domain]
@property_hash = self.class.system_request('user', 'create', properties)
@property_hash[:name] = resource[:name]
@property_hash[:domain] = user_domain
@property_hash[:domain] = resource[:domain]
@property_hash[:ensure] = :present
end