Commit 8daa8ba6 authored by zolliker's avatar zolliker
Browse files

add UUID from mac adress

parent f188b34e
......@@ -31,7 +31,7 @@ def write_when_new(filename, content, doit):
return True
def create_if(name, cfg):
def create_if(name, cfg, mac):
result = dict(
TYPE='Ethernet',
NAME=name,
......@@ -41,6 +41,7 @@ def create_if(name, cfg):
PROXY_METHOD='none',
BROWSER_ONLY='no',
IPV4_FAILURE_FATAL='yes',
UUID='58d61ced-05d2-4726-a8f7-%s' % ''.join(mac.split(':')),
IPV6INIT='no')
if cfg == 'off':
result['ONBOOT']='no'
......@@ -172,7 +173,7 @@ def network(doit):
parser.read(cfgfile)
network = dict(parser['NETWORK'])
for ifname in IFNAMES:
content = create_if(ifname, network.get(ifname, 'off'))
content = create_if(ifname, network.get(ifname, 'off'), netaddr_dict[ifname])
content = '\n'.join('%s=%s' % kv for kv in content.items())
todo = write_when_new('/etc/sysconfig/network-scripts/ifcfg-%s' % ifname, content, doit)
if todo:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment