Puppet::Provider::Openstack::Auth tries to parse openrc autocompletion

Bug #1699950 reported by David Moreau Simard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-openstacklib
Fix Released
Medium
Alex Schultz

Bug Description

When trying to upgrade an environment from Newton to Ocata, I bumped into the following error when running puppet:

Error: Failed to apply catalog: undefined method `chomp' for nil:NilClass

I've eventually isolated the issue down to when keystone::resource::service_identity ran.
After adding some debug code inside Puppet::Provider::Openstack::Auth, I noticed that it tried to parse values out of the autocompletion inside openrc.

Here's a debug patch:
====
--- a/lib/puppet/provider/openstack/auth.rb
+++ b/lib/puppet/provider/openstack/auth.rb
@@ -18,8 +18,14 @@ module Puppet::Provider::Openstack::Auth
       File.open(rcfile).readlines.delete_if{|l| l=~ /^#|^$/ }.each do |line|
         key, value = line.split('=')
         key = key.split(' ').last
- value = value.chomp.gsub(/'/, '')
- env.merge!(key => value) if key =~ /OS_/
+ if value.nil?
+ puts "not chomping this key: " + key
+ else
+ puts "about to chomp: " + value
+ value = value.chomp.gsub(/'/, '')
+ puts "chomped"
+ env.merge!(key => value) if key =~ /OS_/
+ end
       end
     end
     return env
====

And the eventual output (truncated):
====
Notice: Compiled catalog for centos-testing.openstacklocal in environment production in 4.89 seconds
about to chomp: 'true'
chomped
about to chomp: 'openstack'
chomped
about to chomp: 'admin'
chomped
about to chomp: 'password'
chomped
about to chomp: 'http://controller.openstack.home:5000/v3/'
chomped
about to chomp: 'keystone'
chomped
about to chomp: 'RegionOne'
chomped
about to chomp: 'default'
chomped
about to chomp: 'default'
chomped
about to chomp: 'publicURL'
chomped
about to chomp: 'publicURL'
chomped
about to chomp: 'publicURL'
chomped
about to chomp: 'publicURL'
chomped
about to chomp: 'publicURL'
chomped
about to chomp: '3'
chomped
not chomping this key: _openstack()
not chomping this key: {
not chomping this key: words
about to chomp: ()
chomped
not chomping this key: words
not chomping this key: data:
about to chomp: 'access address aggregate availability backup catalog command complete compute configuration consistency console consumer container credential dns domain ec2 endpoint extension federation firewall flavor floating group help host hypervisor identity image ip keypair limits mapping module network object policy port project ptr quota recordset region request role router security server service snapshot subnet tld token trust usage user volume zone'
chomped
about to chomp: 'token'
chomped
about to chomp: 'create'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --consumer-key --consumer-secret --request-key --request-secret --verifier'
chomped
about to chomp: 'scope'
chomped
about to chomp: 'create delete list set show'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --ip-version --project --project-domain --share --no-share'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --name --ip-version --project --project-domain --share --no-share'
chomped
about to chomp: '-h --help --name --share --no-share'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: 'add create delete list remove set show unset'
chomped
about to chomp: 'host'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --zone --property'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --long'
chomped
about to chomp: 'host'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: '-h --help --name --zone --property --no-property'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: '-h --help --property'
chomped
about to chomp: 'zone'
chomped
about to chomp: 'list'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --compute --network --volume --long'
chomped
about to chomp: 'create delete list restore show'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --name --description --container --snapshot --force --incremental'
chomped
about to chomp: '-h --help --force'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --long --name --status --volume --marker --limit --all-projects'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: 'list show'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: 'list'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote'
chomped
about to chomp: '-h --help --name --shell'
chomped
about to chomp: 'agent service'
chomped
about to chomp: 'create delete list set'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --hypervisor'
chomped
about to chomp: '-h --help --agent-version --url --md5hash'
chomped
about to chomp: 'delete list set'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --host --service --long'
chomped
about to chomp: '-h --help --enable --disable --disable-reason --up --down'
chomped
about to chomp: 'show'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --mask --unmask'
chomped
about to chomp: 'group'
chomped
about to chomp: 'add create delete list remove set show snapshot'
chomped
about to chomp: 'volume'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --volume-type --consistency-group-source --consistency-group-snapshot --description --availability-zone'
chomped
about to chomp: '-h --help --force'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --all-projects --long'
chomped
about to chomp: 'volume'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help --name --description'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
chomped
about to chomp: 'create delete list show'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix --consistency-group --description'
chomped
about to chomp: '-h --help'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --quote --all-projects --long --status --consistency-group'
chomped
about to chomp: '-h --help -f --format -c --column --max-width --print-empty --noindent --variable --prefix'
====

Revision history for this message
Alex Schultz (alex-schultz) wrote :
Changed in puppet-openstacklib:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Alex Schultz (alex-schultz)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-openstacklib 11.2.0

This issue was fixed in the openstack/puppet-openstacklib 11.2.0 release.

Changed in puppet-openstacklib:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.