Fix: reap.py: puppet-managed ifcfg files. 41/15841/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 17 Jun 2016 17:58:13 +0000 (19:58 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 17 Jun 2016 17:58:44 +0000 (19:58 +0200)
Skip parsing comment lines in ifcfg-ethX files at reap, e.g.:

Change-Id: Ide6b2111619f7558f1434fda5cd254b842cef0ae
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
patches/opnfv-fuel/0008-deploy-reap.py-Dump-extra-interfaces-information.patch

index 7cb759e..9ed79cc 100644 (file)
@@ -51,7 +51,7 @@ index ed5bc99..9f14e35 100644
  
  from common import (
      N,
-@@ -248,6 +250,38 @@ class Reap(object):
+@@ -248,6 +250,40 @@ class Reap(object):
              if key not in ['ipaddress', 'netmask',
                             'dhcp_pool_start', 'dhcp_pool_end', 'ssh_network']:
                  del fuel['ADMIN_NETWORK'][key]
@@ -78,6 +78,8 @@ index ed5bc99..9f14e35 100644
 +            ifcfg_f = ('/etc/sysconfig/network-scripts/ifcfg-%s' % ifcfg_name)
 +            with open(ifcfg_f) as f:
 +                for line in f:
++                    if line.startswith('#'):
++                        continue
 +                    (key, val) = line.split('=')
 +                    ifcfg_data[key.lower()] = val.rstrip()
 +