aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/utils.py
AgeCommit message (Collapse)AuthorFilesLines
2016-02-12launchpad bug 1537330, fix _is_active_nicxinwu1-5/+3
The detailed bug description is at https://bugs.launchpad.net/os-net-config/+bug/1537330 Since kilo, os-net-config starts to support linux bond. However, the addr_assign_type value of an active member interface of a linux bond is 3, but not 0. The consequence of this problem is that the linux bond member links are never considered as active, this further messes up the nicX to interface name mapping. This change checks if device directory exists, instead of checking the addr_assign_type value. This directory exists only when the interface is an actual physical interface. Change-Id: I8e4c95a2efa809fd236b07cbce1b81a2e774f858
2015-10-19Added natural sort for interfaces in utils.ordered_active_nics()bdemers1-1/+12
This way device eth10 is after eth9, and not directly after eth1 Change-Id: I81eba97cccf6c4f314f9037d16ee1f244dbade02 Closes-Bug: #1482818
2015-05-14Add 'eno*' interfaces to embedded_nicsDan Sneddon1-1/+2
On certain systems, the embedded NICs appear as eno1, eno2, etc. This patch adds 'eno' to 'em' and 'eth' as interface names that should be considered embedded NICs. Change-Id: Icc49596573bdbb8af25f934a647f0a2ab82adaa5
2014-08-22Don't log errors if files don't exists.Dan Prince1-1/+5
Update the utils.get_file_data method so that it doesn't log errors if a file doesn't exist.
2014-08-20Add nic1, nic2 naming abstractionDan Prince1-4/+45
Implements a new active NIC abstraction and naming convention that allows nic1, nic2, etc. to be translated to actual (active) network device names like em1, em2 (or eth0, eth1). This includes some logic to map ordered active nics to the nic1, nic2 naming scheme. Embedded nics are always listed first (in sort order) followed by any other active Nics on the system. With the new code: {"type": "interface", "name": "nic1" } is automatically translated (internally) to: {"type": "interface", "name": "em1" } This works for all top level "interface" devices, vlans, bonds, and bridges alike. For vlans the 'device' name is translated instead of the device name per vlan object conventions.
2014-08-12Set the MAC to the primary interfaceDan Prince1-0/+9
Adds support for a new 'primary' interface option exposed via the object model and JSON parsers which can be used to force the MAC address on a bridge. Only one interface on a given bridge (or bond) may be set as the primary interface. Also, update the ifcfg and eni providers so that they use OVS_EXTRA (or ovs_extra) to pin the mac accordingly.
2014-07-09Add logging to utils.Dan Prince1-1/+11
2014-07-07Add copyrights to files.Dan Prince1-0/+2
2014-06-10Implement apply for ifcfg implementationDan Prince1-0/+30
Adds an apply function to the ifcfg implementation which: 1) Shuts down existing interfaces w/ ifdown 2) writes new interfaces config files (routes too) 3) Starts up new interfaces w/ ifup