keystone_endpoint report undefined method `[]' for nil:NilClass when executing instances method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
puppet-keystone |
Fix Released
|
Critical
|
Sofer Athlan-Guyot |
Bug Description
This is a bug in the lib/puppet/
Now keystone_endpoint is managing admin/internal/
```
def self.instances
names = []
list = []
endpoints.each do |current|
name = transform_
unless names.include?
names << name
endpoint = { :name => name, current[
if (ep_osc[:id] != current[:id]) &&
end
end
list << endpoint
end
end
list.collect do |endpoint|
new(
:name => endpoint[:name],
:ensure => :present,
:id => "#{endpoint[
:region => endpoint[
:admin_url => endpoint[
:public_url => endpoint[
)
end
end
```
Say I have only admin and internal url of neutron, the endpoint[:public] is nil, and endpoint[
Secondly, even if I can fix this bug by adding some nil check. Say I do not have admin url of neutron. What I expect to happen after a puppet run is that adding a missing admin url of neutron. But the actual behavior is that puppet can only change exist admin url to a right one but not adding a new one. See code below
```
def flush
if @property_flush && @property_hash[:id]
ids = @property_
if @property_
end
if @property_
end
if @property_
end
end
@property_hash = resource.to_hash
end
```
The flush method can change a wrong endpoint to a right one, but dose not support adding a missing endpoint. So we need to add some logic here to handle that when some of admin/internal/
I'm not a ruby guru but I'm trying my best to fix these bugs. I've already commit a patch and tested it. Welcome for advices.
description: | updated |
Changed in puppet-keystone: | |
assignee: | nobody → Liao Penghui (liaoishere) |
Changed in puppet-keystone: | |
importance: | Undecided → Critical |
description: | updated |
Fix proposed to branch: master /review. openstack. org/294506
Review: https:/