
... so that the credentials in clouds.yaml file can be used if available instead of openrc. Also, the transformation from project name to project uuid is still needed so the transform_to method has been undeprecated. Change-Id: I0e0d42d92e8272f3f7faf809e07e599805bbedaa
27 lines
761 B
Ruby
27 lines
761 B
Ruby
require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/ironic')
|
|
|
|
Puppet::Type.type(:ironic_config).provide(
|
|
:openstackconfig,
|
|
:parent => Puppet::Type.type(:openstack_config).provider(:ruby)
|
|
) do
|
|
|
|
def self.file_path
|
|
'/etc/ironic/ironic.conf'
|
|
end
|
|
|
|
def to_project_uuid(name)
|
|
properties = [name, '--column', 'id']
|
|
ironic_provider = Puppet::Provider::Ironic
|
|
res = ironic_provider.system_request('project', 'show', properties)
|
|
return "AUTH_#{res[:id]}"
|
|
end
|
|
|
|
def from_project_uuid(uuid)
|
|
uuid = uuid.sub('AUTH_','')
|
|
properties = [uuid, '--column', 'name']
|
|
ironic_provider = Puppet::Provider::Ironic
|
|
res = ironic_provider.system_request('project', 'show', properties)
|
|
return res[:name]
|
|
end
|
|
end
|