X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_tenant.rb;h=449ccd04e36043374bbb21414f1d661e85fd59ae;hb=2dc39f2a756f82040d82cba324b21f44fad8ef3f;hp=3e1de7f3784e649f6dd1d06afbd9dcc31f456885;hpb=52e13a709b5b959cd8995e7fa4f1b226bbe13a87;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb index 3e1de7f37..449ccd04e 100644 --- a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb +++ b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb @@ -1,6 +1,8 @@ # LP#1408531 File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } -require 'puppet/util/openstack' +File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } +require 'puppet/provider/keystone/util' + Puppet::Type.newtype(:keystone_tenant) do desc 'This type can be used to manage keystone tenants.' @@ -33,6 +35,20 @@ Puppet::Type.newtype(:keystone_tenant) do end end + newproperty(:domain) do + desc 'Domain for tenant.' + newvalues(nil, /\S+/) + def insync?(is) + raise(Puppet::Error, "The domain cannot be changed from #{self.should} to #{is}") unless self.should == is + true + end + end + + autorequire(:keystone_domain) do + # use the domain parameter if given, or the one from name if any + self[:domain] || Util.split_domain(self[:name])[1] + end + # This ensures the service is started and therefore the keystone # config is configured IF we need them for authentication. # If there is no keystone config, authentication credentials @@ -40,10 +56,4 @@ Puppet::Type.newtype(:keystone_tenant) do autorequire(:service) do ['keystone'] end - - auth_param_doc=<