Steps to reproduce:
1) Stop the rug or delete the tenant router
2) rename or remove the provider rules file configured at provider_rules_path
3) star the rug or create a router
When the vm boots and the rug attempst to configure it, it throws an uncaught exception trying to open the missing file and continues with configuration, failing and continuously retrying:
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:ConfigureVM.execute(update) vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:Begin router config
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:MACs found: fa:16:3e:29:b4:11, fa:16:3e:57:e9:d4, fa:16:3e:c3:86:2d
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:MACs expected: fa:16:3e:29:b4:11, fa:16:3e:57:e9:d4, fa:16:3e:c3:86:2d
2015-06-03 09:26:24:ERROR:akanda.rug.api.configuration:14627:p00:t00:unable to open provider rules: /opt/stack/akanda-rug/etc/foo_provider_rules.json
Traceback (most recent call last):
File "/opt/stack/akanda-rug/akanda/rug/api/configuration.py", line 113, in load_provider_rules
return jsonutils.load(open(path))
IOError: [Errno 2] No such file or directory: '/opt/stack/akanda-rug/etc/foo_provider_rules.json'
2015-06-03 09:26:24:DEBUG:akanda.rug.api.configuration:14627:p00:t00:networks = [{'subnets': [{'host_routes': [], 'cidr': 'fdee:9f85:83be::/48', 'gateway_ip': 'fdee:9f85:83be::1', 'dns_nameservers': [], 'dhcp_enabled': True}, {'host_routes': [], 'cidr': '172.16.77.0/24', 'gateway_ip': '172.16.77.1', 'dns_nameservers': [], 'dhcp_enabled': True}], 'v6_conf_service': 'static', 'network_id': u'aec8f0e7-ba66-4cce-a4b0-753c86f811f6', 'allocations': [], 'interface': {'ifname': u'ge1', 'addresses': ['172.16.77.2/24', 'fdee:9f85:83be::2/48']}, 'v4_conf_service': 'static', 'network_type': 'external'}, {'subnets': [{'host_routes': [], 'cidr': 'fdca:3ba5:a17a:acda::/64', 'gateway_ip': 'fdca:3ba5:a17a:acda::1', 'dns_nameservers': [], 'dhcp_enabled': True}], 'v6_conf_service': 'static', 'network_id': u'4132a403-b841-4a5f-b554-2f4be977abb1', 'allocations': [], 'interface': {'ifname': u'ge0', 'addresses': ['fdca:3ba5:a17a:acda:f816:3eff:fe29:b411/64']}, 'v4_conf_service': 'static', 'network_type': 'management'}, {'subnets': [{'host_routes': [], 'cidr': 'fdd6:a1fa:cfa8:5869::/64', 'gateway_ip': 'fdd6:a1fa:cfa8:5869::1', 'dns_nameservers': [], 'dhcp_enabled': False}, {'host_routes': [], 'cidr': '192.168.0.0/24', 'gateway_ip': '192.168.0.1', 'dns_nameservers': [], 'dhcp_enabled': True}], 'v6_conf_service': 'static', 'network_id': u'6c62eac5-5e22-4b7b-b73b-14dfa62af516', 'allocations': [{'mac_address': u'fa:16:3e:02:d1:e7', 'ip_addresses': {'fdd6:a1fa:cfa8:5869::1': True, '192.168.0.1': True}, 'hostname': '192-168-0-1.local', 'device_id': u'6003d4f1-81de-4ca9-9228-c7e40122e843'}], 'interface': {'ifname': u'ge2', 'addresses': ['192.168.0.1/24', 'fdd6:a1fa:cfa8:5869::1/64']}, 'v4_conf_service': 'static', 'network_type': 'internal'}]
2015-06-03 09:26:24:DEBUG:akanda.rug.api.configuration:14627:p00:t00:external interface = fa:16:3e:1c:8f:e6
2015-06-03 09:26:24:DEBUG:akanda.rug.api.configuration:14627:p00:t00:6003d4f1-81de-4ca9-9228-c7e40122e843: checking if subnet 172.16.77.0/24 should have the default route
2015-06-03 09:26:24:DEBUG:akanda.rug.api.configuration:14627:p00:t00:6003d4f1-81de-4ca9-9228-c7e40122e843: found gateway 172.16.77.1 for subnet 172.16.77.0/24 on network aec8f0e7-ba66-4cce-a4b0-753c86f811f6
2015-06-03 09:26:24:ERROR:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:ConfigureVM.execute() failed for action: update
Traceback (most recent call last):
File "/opt/stack/akanda-rug/akanda/rug/state.py", line 430, in update
worker_context,
File "/opt/stack/akanda-rug/akanda/rug/state.py", line 319, in execute
self.vm.configure(worker_context)
File "/opt/stack/akanda-rug/akanda/rug/vm_manager.py", line 348, in configure
iface_map
File "/opt/stack/akanda-rug/akanda/rug/api/configuration.py", line 62, in build_config
'labels': provider_rules.get('labels', {}),
AttributeError: 'NoneType' object has no attribute 'get'
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:ConfigureVM.transition(update) -> PushUpdate vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:PushUpdate.execute(update) vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:PushUpdate.execute -> update vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:PushUpdate.transition(update) -> CalcAction vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.worker:14627:p00:t00:6003d4f1-81de-4ca9-9228-c7e40122e843 has more work, returning to work queue
2015-06-03 09:26:24:DEBUG:akanda.rug.worker:14627:p00:t00:performing work on 6003d4f1-81de-4ca9-9228-c7e40122e843 for tenant 54dacf41-d825-4683-be02-93c6a9cbef48
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:CalcAction.execute(update) vm.state=up
2015-06-03 09:26:24:DEBUG:akanda.rug.state.6003d4f1-81de-4ca9-9228-c7e40122e843:14627:p00:t00:action = update, len(queue) = 1, queue = ['update']
Fix proposed to branch: master /review. openstack. org/188079
Review: https:/