Fix image list in glance_image provider
https://review.openstack.org/298718 changed the way images are listed,
by removing the '--long' parameter. This breaks when called by the
openstacklib provider, because that was the "properties" argument in
adb0b1d012/lib/puppet/provider/openstack.rb (L74)
so the command-line used '' as a last argument, causing the failure.
This will require a stable/mitaka backport.
Change-Id: I69e3cc848fbacbda01f9bd7d8a079c99b15cb5cf
This commit is contained in:
parent
31c15aefd4
commit
109cda8b24
@ -93,7 +93,7 @@ Puppet::Type.type(:glance_image).provide(
|
||||
end
|
||||
|
||||
def self.instances
|
||||
list = request('image', 'list')
|
||||
list = request('image', 'list', '--long')
|
||||
list.collect do |image|
|
||||
attrs = request('image', 'show', image[:id])
|
||||
properties = Hash[attrs[:properties].scan(/(\S+)='([^']*)'/)] rescue nil
|
||||
|
@ -79,9 +79,9 @@ visibility="public"
|
||||
describe '.instances' do
|
||||
it 'finds every image' do
|
||||
provider.class.stubs(:openstack)
|
||||
.with('image', 'list', '--quiet', '--format', 'csv', [])
|
||||
.returns('"ID","Name","Status"
|
||||
"5345b502-efe4-4852-a45d-edaba3a3acc6","image1","active"
|
||||
.with('image', 'list', '--quiet', '--format', 'csv', '--long')
|
||||
.returns('"ID","Name","Disk Format","Container Format","Size","Status"
|
||||
"5345b502-efe4-4852-a45d-edaba3a3acc6","image1","raw","bare",1270,"active"
|
||||
')
|
||||
provider.class.stubs(:openstack)
|
||||
.with('image', 'show', '--format', 'shell', '5345b502-efe4-4852-a45d-edaba3a3acc6')
|
||||
@ -169,9 +169,9 @@ visibility="public"
|
||||
describe '.instances' do
|
||||
it 'finds every image' do
|
||||
provider.class.stubs(:openstack)
|
||||
.with('image', 'list', '--quiet', '--format', 'csv', [])
|
||||
.returns('"ID","Name","Status"
|
||||
"5345b502-efe4-4852-a45d-edaba3a3acc6","image1","active"
|
||||
.with('image', 'list', '--quiet', '--format', 'csv', '--long')
|
||||
.returns('"ID","Name","Disk Format","Container Format","Size","Status"
|
||||
"5345b502-efe4-4852-a45d-edaba3a3acc6","image1","raw","bare",1270,"active"
|
||||
')
|
||||
provider.class.stubs(:openstack)
|
||||
.with('image', 'show', '--format', 'shell', '5345b502-efe4-4852-a45d-edaba3a3acc6')
|
||||
|
Loading…
Reference in New Issue
Block a user