diff --git a/src/hostinfo/ifconfig.py b/src/hostinfo/ifconfig.py index 28bdc18e717503be234389e7af16160487cbdc63..c3bc2cda9c52fd27f4a8898f8e203878e4072d04 100755 --- a/src/hostinfo/ifconfig.py +++ b/src/hostinfo/ifconfig.py @@ -2,6 +2,7 @@ import hostinfo.util as util import subprocess import re import ipaddr +import sys def get_nm_extra(device): result = "" @@ -222,7 +223,8 @@ def generate(tree, host): continue device_name = device(i.ethernet[0]) if i.bridge[0]: - config = 'DEVICE=%s\n' % i.bridge[0] + config = '# Generated by %s\n' % (' '.join(sys.argv)) + config += 'DEVICE=%s\n' % i.bridge[0] config += 'NAME="%s"\n' % i.bridge[0] config += 'ONBOOT=yes\n' config += 'TYPE=Bridge\n' @@ -231,7 +233,8 @@ def generate(tree, host): config += generate_ifcfg(tree, i) result.append(('ifcfg-%s' % i.bridge[0], config)) - config = 'DEVICE=%s\n' % device_name + config = '# Generated by %s\n' % (' '.join(sys.argv)) + config += 'DEVICE=%s\n' % device_name config += 'NAME="%s"\n' % device_name config += 'HWADDR=%s\n' % i.ethernet[0].upper() config += 'ONBOOT=yes\n' @@ -241,7 +244,8 @@ def generate(tree, host): result.append(('ifcfg-%s' % device_name, config)) pass elif i.ethernet[0]: - config = 'DEVICE=%s\n' % device_name + config = '# Generated by %s\n' % (' '.join(sys.argv)) + config += 'DEVICE=%s\n' % device_name config += 'NAME="%s"\n' % device_name config += 'HWADDR=%s\n' % i.ethernet[0].upper() config += 'ONBOOT=yes\n'