Bug #23653
closedparsing facts break interfaces names
Description
Import interfaces broken while parsing facts:
2018-05-20T10:46:17 88de1713 [app] [D] We have following interfaces 'br-private, enp2s0f0, enp2s0f1, bond1.1005, br-ipo, br-ipo-nic, enp130s0f0, enp130s0f1, enp129s0f0, enp129s0f1, bond0, bond1' based on facts
2018-05-20T10:46:17 88de1713 [app] [D] Saving br_private NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [W] Saving br_private NIC for host cloud-lab15.example.org failed, skipping because:
2018-05-20T10:46:18 88de1713 [app] [W] Identifier has already been taken
2018-05-20T10:46:18 88de1713 [app] [D] Saving enp2s0f0 NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [D] Saving enp2s0f1 NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [D] Saving bond1.1005 NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [D] Saving br_ipo NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [D] Saving br_ipo_nic NIC for host cloud-lab15.example.org
2018-05-20T10:46:18 88de1713 [app] [D] Saving enp130s0f0 NIC for host cloud-lab15.example.org
2018-05-20T10:46:19 88de1713 [app] [D] Saving enp130s0f1 NIC for host cloud-lab15.example.org
2018-05-20T10:46:19 88de1713 [app] [D] Saving enp129s0f0 NIC for host cloud-lab15.example.org
2018-05-20T10:46:19 88de1713 [app] [D] Saving enp129s0f1 NIC for host cloud-lab15.example.org
2018-05-20T10:46:19 88de1713 [app] [D] Saving bond0 NIC for host cloud-lab15.example.org
2018-05-20T10:46:19 88de1713 [app] [D] Saving bond1 NIC for host cloud-lab15.example.org
Some interfaces are broken (renamed) and some absent:
- hammer host interface list --host-id 1
---|------------|--------------------------------|-------------------|-------------|------------------------
ID | IDENTIFIER | TYPE | MAC ADDRESS | IP ADDRESS | DNS NAME
---|------------|--------------------------------|-------------------|-------------|------------------------
8 | bond1 | bond | 2c:9d:1e:b1:f5:f6 | |
7 | bond0 | bond | 2c:9d:1e:b1:f5:f5 | |
1 | enp129s0f1 | interface (primary, provision) | 2c:9d:1e:b1:f5:f6 | | cloud-lab15.example.org
6 | enp129s0f0 | interface | 2c:9d:1e:b1:f5:f5 | |
5 | br_ipo_nic | interface | 52:54:00:cd:a9:9c | |
4 | br_ipo | interface | 52:54:00:cd:a9:9c | 192.168.1.1 |
3 | enp2s0f1 | interface | 2c:9d:1e:6c:d3:c6 | |
2 | enp2s0f0 | interface | 2c:9d:1e:6c:d3:c5 | |
---|------------|--------------------------------|-------------------|-------------|------------------------
We need the same behavior used in the: https://github.com/theforeman/foreman/blob/develop/app/services/puppet_fact_parser.rb#L132-L139