aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2015-01-21 17:24:08 +0000
committerSteven Hardy <shardy@redhat.com>2015-02-24 09:20:41 +0000
commita4ad189558a414c6029b4dfbc8e459339ebe534d (patch)
tree0c39889bc89c461803f03b4cb9ae89e8bd4c0033 /os_net_config/impl_ifcfg.py
parent6945fe5afdc12574fe00ad440319b7873f818e84 (diff)
Add a persist_mapping option to the mapping file
This adds the option to permanently rewrite the configuration so the aliases are used instead of the system name. This is useful where you have a variety of hardware and you want to have consistent device naming accross all platforms - this allows you to essentially rename the interfaces permanently so they match the abstracted nicN names. Note, this needs to be run with --cleanup or the old (now conflicting) configs will still be in place, and it may require a reboot before the changes are fully applied. Change-Id: I5af146e764b72c4beaa41c549fabff0af8802152
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index c871296..a728f53 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -142,6 +142,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
first_v6 = v6_addresses[0]
data += "IPV6_AUTOCONF=no\n"
data += "IPV6ADDR=%s\n" % first_v6.ip
+ if base_opt.hwaddr:
+ data += "HWADDR=%s\n" % base_opt.hwaddr
if ovs_extra:
data += "OVS_EXTRA=\"%s\"\n" % " -- ".join(ovs_extra)
return data