You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launchpad user Roopak Parikh(rparikh) wrote on 2015-04-26T05:32:30.406553+00:00
I have a VirtualMachine image (Scientific Linux 6.4) which has a static IP address assigned to it. Using Openstack and using 'config-drive' we tried to boot a new VirtualMachine from that image, config-drive, the ISO contains a new 'static-ip' address. Cloud-init recognizes that and tries to read the existing /etc/sysconfig/network-scripts/ifcfg-eth0 and fails with the following error:
Apr 24 18:04:13 rparikh-sl6-w-cloud-init [CLOUDINIT] util.py[DEBUG]: Getting data from <class 'cloudinit.sources.DataSourceConfigDrive.DataSourceConfigDrive'> failed#012Traceback (most recent call last):#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/init.py", line 243, in find_source#012 if s.get_data():#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/DataSourceConfigDrive.py", line 212, in get_data#012 self.helper.on_first_boot(results)#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/DataSourceConfigDrive.py", line 54, in on_first_boot#012 self.distro.apply_network(data['network_config'])#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/init.py", line 116, in apply_network#012 dev_names = self._write_network(settings)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 85, in _write_network#012 rhel_util.update_sysconfig_file(net_fn, net_cfg)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel_util.py", line 125, in update_sysconfig_file#012 (exists, contents) = read_sysconfig_file(fn)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel_util.py", line 153, in read_sysconfig_file#012 return (exists, SysConf(contents))#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/parsers/sys_conf.py", line 60, in init#12 write_empty_values=True)#12 File "/usr/lib/python2.6/site-packages/configobj.py", line 1219, in init#12 self._load(infile, configspec)#12 File "/usr/lib/python2.6/site-packages/configobj.py", line 1302, in _load#012 raise error#012DuplicateError: Duplicate keyword name at line 24.
The problem seems to be duplicate keys in the ifcfg-eth0, we can try and fix this image, but there are probably others with the same settings and in general I would assume parsing should be resilient to these failures. In addition I am not sure if I understand the logic behind reading the current ifcfg and modifying it, we should be able to simplify it by overwriting (a backup can be taken for debugging purposes) the ifcfg file.
Attached is a screenshot with contents of the ifcfg file.
The text was updated successfully, but these errors were encountered:
Launchpad user Roopak Parikh(rparikh) wrote on 2019-02-19T17:56:46.817671+00:00
I haven't looked at the code in the last few years, so not sure if this is fixed or not. Since no one else has complained and it was observed on the 6.x CentOS, I am ok to close it as stale entry and may not be applicable anymore.
This bug was originally filed in Launchpad as LP: #1448594
Launchpad details
Launchpad user Roopak Parikh(rparikh) wrote on 2015-04-26T05:32:30.406553+00:00
I have a VirtualMachine image (Scientific Linux 6.4) which has a static IP address assigned to it. Using Openstack and using 'config-drive' we tried to boot a new VirtualMachine from that image, config-drive, the ISO contains a new 'static-ip' address. Cloud-init recognizes that and tries to read the existing /etc/sysconfig/network-scripts/ifcfg-eth0 and fails with the following error:
Apr 24 18:04:13 rparikh-sl6-w-cloud-init [CLOUDINIT] util.py[DEBUG]: Getting data from <class 'cloudinit.sources.DataSourceConfigDrive.DataSourceConfigDrive'> failed#012Traceback (most recent call last):#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/init.py", line 243, in find_source#012 if s.get_data():#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/DataSourceConfigDrive.py", line 212, in get_data#012 self.helper.on_first_boot(results)#12 File "/usr/lib/python2.6/site-packages/cloudinit/sources/DataSourceConfigDrive.py", line 54, in on_first_boot#012 self.distro.apply_network(data['network_config'])#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/init.py", line 116, in apply_network#012 dev_names = self._write_network(settings)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel.py", line 85, in _write_network#012 rhel_util.update_sysconfig_file(net_fn, net_cfg)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel_util.py", line 125, in update_sysconfig_file#012 (exists, contents) = read_sysconfig_file(fn)#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/rhel_util.py", line 153, in read_sysconfig_file#012 return (exists, SysConf(contents))#12 File "/usr/lib/python2.6/site-packages/cloudinit/distros/parsers/sys_conf.py", line 60, in init#12 write_empty_values=True)#12 File "/usr/lib/python2.6/site-packages/configobj.py", line 1219, in init#12 self._load(infile, configspec)#12 File "/usr/lib/python2.6/site-packages/configobj.py", line 1302, in _load#012 raise error#012DuplicateError: Duplicate keyword name at line 24.
The problem seems to be duplicate keys in the ifcfg-eth0, we can try and fix this image, but there are probably others with the same settings and in general I would assume parsing should be resilient to these failures. In addition I am not sure if I understand the logic behind reading the current ifcfg and modifying it, we should be able to simplify it by overwriting (a backup can be taken for debugging purposes) the ifcfg file.
Attached is a screenshot with contents of the ifcfg file.
The text was updated successfully, but these errors were encountered: