From 567bf0863e4648c1727a756aad6ce90ee947e7f0 Mon Sep 17 00:00:00 2001 From: Aimon Bustardo Date: Sun, 11 Nov 2012 14:11:26 -0800 Subject: [PATCH] Move from parsing glance-api-paste.ini to glance-api.conf --- lib/puppet/provider/glance.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/puppet/provider/glance.rb b/lib/puppet/provider/glance.rb index 47db328a..f08c1773 100644 --- a/lib/puppet/provider/glance.rb +++ b/lib/puppet/provider/glance.rb @@ -9,24 +9,24 @@ class Puppet::Provider::Glance < Puppet::Provider end def self.get_glance_credentials - if glance_file and glance_file['filter:authtoken'] and - glance_file['filter:authtoken']['auth_host'] and - glance_file['filter:authtoken']['auth_port'] and - glance_file['filter:authtoken']['auth_protocol'] and - glance_file['filter:authtoken']['admin_tenant_name'] and - glance_file['filter:authtoken']['admin_user'] and - glance_file['filter:authtoken']['admin_password'] + if glance_file and glance_file['keystone_authtoken'] and + glance_file['keystone_authtoken']['auth_host'] and + glance_file['keystone_authtoken']['auth_port'] and + glance_file['keystone_authtoken']['auth_protocol'] and + glance_file['keystone_authtoken']['admin_tenant_name'] and + glance_file['keystone_authtoken']['admin_user'] and + glance_file['keystone_authtoken']['admin_password'] g = {} - g['auth_host'] = glance_file['filter:authtoken']['auth_host'].strip - g['auth_port'] = glance_file['filter:authtoken']['auth_port'].strip - g['auth_protocol'] = glance_file['filter:authtoken']['auth_protocol'].strip - g['admin_tenant_name'] = glance_file['filter:authtoken']['admin_tenant_name'].strip - g['admin_user'] = glance_file['filter:authtoken']['admin_user'].strip - g['admin_password'] = glance_file['filter:authtoken']['admin_password'].strip + g['auth_host'] = glance_file['keystone_authtoken']['auth_host'].strip + g['auth_port'] = glance_file['keystone_authtoken']['auth_port'].strip + g['auth_protocol'] = glance_file['keystone_authtoken']['auth_protocol'].strip + g['admin_tenant_name'] = glance_file['keystone_authtoken']['admin_tenant_name'].strip + g['admin_user'] = glance_file['keystone_authtoken']['admin_user'].strip + g['admin_password'] = glance_file['keystone_authtoken']['admin_password'].strip return g else - raise(Puppet::Error, 'File: /etc/glance/glance-api-paste.ini does not contain all required sections.') + raise(Puppet::Error, 'File: /etc/glance/glance-api.conf does not contain all required sections.') end end @@ -46,7 +46,7 @@ class Puppet::Provider::Glance < Puppet::Provider def self.glance_file return @glance_file if @glance_file @glance_file = Puppet::Util::IniConfig::File.new - @glance_file.read('/etc/glance/glance-api-paste.ini') + @glance_file.read('/etc/glance/glance-api.conf') @glance_file end