X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Fprovider%2Fkeystone_endpoint%2Fopenstack.rb;fp=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Fprovider%2Fkeystone_endpoint%2Fopenstack.rb;h=0000000000000000000000000000000000000000;hb=6e1426dc77fb4e5d51f07c187c6f2219431dc31e;hp=97de693d86853f48639f65f9c2ff99db67e05442;hpb=87423ba664cd5f2bb462ebadd08b1a90d0fe1c8d;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/provider/keystone_endpoint/openstack.rb b/3rdparty/modules/keystone/lib/puppet/provider/keystone_endpoint/openstack.rb deleted file mode 100644 index 97de693d8..000000000 --- a/3rdparty/modules/keystone/lib/puppet/provider/keystone_endpoint/openstack.rb +++ /dev/null @@ -1,112 +0,0 @@ -require 'puppet/provider/keystone' - -Puppet::Type.type(:keystone_endpoint).provide( - :openstack, - :parent => Puppet::Provider::Keystone -) do - - desc "Provider to manage keystone endpoints." - - @credentials = Puppet::Provider::Openstack::CredentialsV2_0.new - - def initialize(value={}) - super(value) - @property_flush = {} - end - - def create - properties = [] - # The region property is just ignored. We should fix this in kilo. - region, name = resource[:name].split('/') - properties << name - properties << '--region' - properties << region - if resource[:public_url] - properties << '--publicurl' - properties << resource[:public_url] - end - if resource[:internal_url] - properties << '--internalurl' - properties << resource[:internal_url] - end - if resource[:admin_url] - properties << '--adminurl' - properties << resource[:admin_url] - end - self.class.request('endpoint', 'create', properties) - @property_hash[:ensure] = :present - end - - def destroy - self.class.request('endpoint', 'delete', @property_hash[:id]) - @property_hash.clear - end - - def exists? - @property_hash[:ensure] == :present - end - - def region - @property_hash[:region] - end - - def public_url=(value) - @property_flush[:public_url] = value - end - - def public_url - @property_hash[:public_url] - end - - def internal_url=(value) - @property_flush[:internal_url] = value - end - - def internal_url - @property_hash[:internal_url] - end - - def admin_url=(value) - @property_flush[:admin_url] = value - end - - def admin_url - @property_hash[:admin_url] - end - - def id - @property_hash[:id] - end - - def self.instances - list = request('endpoint', 'list', '--long') - list.collect do |endpoint| - new( - :name => "#{endpoint[:region]}/#{endpoint[:service_name]}", - :ensure => :present, - :id => endpoint[:id], - :region => endpoint[:region], - :public_url => endpoint[:publicurl], - :internal_url => endpoint[:internalurl], - :admin_url => endpoint[:adminurl] - ) - end - end - - def self.prefetch(resources) - endpoints = instances - resources.keys.each do |name| - if provider = endpoints.find{ |endpoint| endpoint.name == name } - resources[name].provider = provider - end - end - end - - def flush - if ! @property_flush.empty? - destroy - create - @property_flush.clear - end - end -end