inmanta / openstack

Moved to https://code.inmanta.com/solutions/modules/openstack
0 stars 2 forks source link

Openstack::Router keyError on reading resource (routes not found) #26

Open Technobeats opened 5 years ago

Technobeats commented 5 years ago

test_neutron.py::test_router unittest returns a stacktrace:

Deploy did not result in correct status
Requested changes:  {}
Log:  An error occurred during deployment of tlnopenstack::Router[test,name=inmanta_unit_test],v=1564643169 (exception: KeyError('routes',))
Kwargs:  ['exc_info: True', 'resource_id: tlnopenstack::Router[test,name=inmanta_unit_test],v=1564643169', "exception: KeyError('routes',)"]
Traceback:
 Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/inmanta/agent/handler.py", line 731, in execute
    self.read_resource(ctx, current)
  File "/tmp/tmptx31kbo1/libs/tlnopenstack/plugins/__init__.py", line 1197, in read_resource
    for route in neutron_version["routes"]:
KeyError: 'routes'

Key routes doesn't always exists:

Print output var 'neutron_version'.

        if len(neutron_version) > 0:
            ctx.set("neutron", neutron_version)
            print("neutron_v %s" % neutron_version)
            resource.purged = False
neutron_v{  
   'status':'ACTIVE',
   'external_gateway_info':{  
      'network_id':'13b3e7fa-35a7-4af7-9a80-ad0e286945a6',
      'enable_snat':True
   },
   'fq_name':[  
      'xx',
      'xx',
      'inmanta_unit_test'
   ],
   'name':'inmanta_unit_test',
   'admin_state_up':True,
   'tenant_id':'9f3503fc4aac4f2590096d4cd36003e1',
   'id':'63151b38-a8bb-40c5-a51a-cb9794a6cd07',
   'description':''
}
arnaudsjs commented 5 years ago

Could you provide me the version number of the openstack module you are using.