os-net-config mapping by MAC fails if trying to map in alternate order
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Expired
|
Undecided
|
Unassigned |
Bug Description
I am running into a stack trace when I try the following:
I want to override the natural ordering of the NICs. For instance:
On host A, I have the following NICs:
em1: 3c:97:0e:e9:27:ca
wlp4s0: 5c:51:4f:f5:79:bd
(note, this is just a test box, it has one wired and one wireless adapter, but that doesn't matter)
If I include a mapping file that matches this order, it works:
interface_mapping:
nic1: 3c:97:0e:e9:27:ca
nic2: 5c:51:4f:f5:79:bd
What I want to do is to map them like this:
interface_mapping:
nic1: 5c:51:4f:f5:79:bd
nic2: 3c:97:0e:e9:27:ca
Which should switch the order. Here is what happens when I try to run that mapping:
$ os-net-config --noop --debug -c /etc/os-
[2015/10/08 11:11:38 AM] [INFO] Using config file at: /etc/os-
[2015/10/08 11:11:38 AM] [INFO] Using mapping file at: /etc/os-
[2015/10/08 11:11:38 AM] [INFO] Ifcfg net config provider created.
[2015/10/08 11:11:38 AM] [DEBUG] network_config JSON: [{'routes': [{'ip_netmask': '169.254.
[2015/10/08 11:11:38 AM] [DEBUG] interface_mapping JSON: {'nic2': '3c:97:
[2015/10/08 11:11:38 AM] [DEBUG] persist_mapping: True
[2015/10/08 11:11:38 AM] [DEBUG] 5c:51:4f:f5:79:bd matches device wlp4s0
[2015/10/08 11:11:38 AM] [INFO] nic1 mapped to: wlp4s0
[2015/10/08 11:11:38 AM] [DEBUG] 3c:97:0e:e9:27:ca matches device em1
[2015/10/08 11:11:38 AM] [INFO] nic2 mapped to: em1
[2015/10/08 11:11:38 AM] [INFO] nic3 mapped to: vlan2
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/lib/
obj = objects.
File "/usr/lib/
return Interface.
File "/usr/lib/
return Interface(name, *opts)
File "/usr/lib/
dhclient_args, dns_servers)
File "/usr/lib/
numbered_
File "/usr/lib/
raise InvalidConfigEx
os_net_
-----
The problem occurs in the _numbered_nics method in objects.py.
Changed in tripleo: | |
status: | New → Triaged |
Changed in tripleo: | |
importance: | Undecided → Medium |
Hmm, I'm pretty sure this worked when I originally implemented the mappings, if you're not already looking into it I can probably help out.