Bug 429725

Summary: s-c-n-cmd cannot import
Product: [Fedora] Fedora Reporter: Chris Adams <linux>
Component: system-config-networkAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: jmoskovc
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.5.5-1.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-22 22:39:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Adams 2008-01-22 18:15:29 UTC
system-config-network-cmd cannot import a config (even an unmodified export).  I
am seeing this with s-c-n-tui-1.4.7-1.fc8:

# system-config-network-cmd -e > /tmp/netconf
# system-config-network-cmd -i -c -f /tmp/netconf
An unhandled exception has occured.  This is most likely a bug.
Please file a detailed bug report against the component system-config-network at 
https://bugzilla.redhat.com/bugzilla
using the text below.
Component: system-config-network
Version: 1.4.7
Summary: TB /usr/sbin/system-config-network-cmd:329:main:NameError: global name
'ParseError' is not defined
Traceback (most recent call last):
  File "/usr/sbin/system-config-network-cmd", line 329, in main
    pe = ParseError(_("Error parsing line: %s") % line)
NameError: global name 'ParseError' is not defined

Local variables in innermost frame:
profileNone
getHardwareList: <function getHardwareList at 0x99be72c>
lines: ['DeviceList.Ethernet.eth0.Hostname=gnat1.hiwaay.net\n',
'DeviceList.Ethernet.eth0.HardwareAddress=00:E0:81:20:6B:25\n',
'DeviceList.Ethernet.eth0.Type=Ethernet\n',
'DeviceList.Ethernet.eth0.BootProto=dhcp\n',
'DeviceList.Ethernet.eth0.Device=eth0\n',
'DeviceList.Ethernet.eth0.OnBoot=True\n',
'DeviceList.Ethernet.eth0.DeviceId=eth0\n',
'DeviceList.Ethernet.eth1.HardwareAddress=00:02:E3:0A:3E:2B\n',
'DeviceList.Ethernet.eth1.Type=Ethernet\n',
'DeviceList.Ethernet.eth1.BootProto=dhcp\n',
'DeviceList.Ethernet.eth1.Device=eth1\n',
'DeviceList.Ethernet.eth1.OnBoot=False\n',
'DeviceList.Ethernet.eth1.DeviceId=eth1\n',
'HardwareList.Ethernet.eth0.Status=ok\n',
'HardwareList.Ethernet.eth0.Name=eth0\n',
'HardwareList.Ethernet.eth0.Type=Ethernet\n',
'HardwareList.Ethernet.eth0.Card.ModuleName=e100\n',
'HardwareList.Ethernet.eth0.Description=Intel Corporation 82557/8/9 Ethernet Pro
100\n', 'HardwareList.Ethernet.eth1.Status=ok\n',
'HardwareList.Ethernet.eth1.Name=eth1\n',
'HardwareList.Ethernet.eth1.Type=Ethernet\n',
'HardwareList.Ethernet.eth1.Card.ModuleName=natsemi\n',
'HardwareList.Ethernet.eth1.Description=National Semiconductor Corporation
DP83815 (MacPhyter) Ethernet Controller\n',
'ProfileList.default.ActiveDevices.1=eth0\n',
'ProfileList.default.ActiveDevices.2=eth1\n',
'ProfileList.default.HostsList.1.IP=127.0.0.1\n',
'ProfileList.default.HostsList.1.Hostname=localhost.localdomain\n',
'ProfileList.default.HostsList.1.AliasList.1=localhost\n',
'ProfileList.default.HostsList.1.AliasList.2=gnat1\n',
'ProfileList.default.HostsList.2.IP=::1\n',
'ProfileList.default.HostsList.2.Hostname=localhost6.localdomain6\n',
'ProfileList.default.HostsList.2.AliasList.1=localhost6\n',
'ProfileList.default.HostsList.3.IP=216.180.46.34\n',
'ProfileList.default.HostsList.3.Hostname=gnat1.hiwaay.net\n',
'ProfileList.default.HostsList.3.AliasList.1=gnat1\n',
'ProfileList.default.DNS.SecondaryDNS=\n',
'ProfileList.default.DNS.SearchList.1=hiwaay.net\n',
'ProfileList.default.DNS.Domainname=\n',
'ProfileList.default.DNS.Hostname=gnat1.hiwaay.net\n',
'ProfileList.default.DNS.TertiaryDNS=\n',
'ProfileList.default.DNS.PrimaryDNS=206.166.206.157\n',
'ProfileList.default.Active=True\n', 'ProfileList.default.ProfileName=default\n']
cmdline: ['-i', '-c', '-f', '/tmp/netconf']
EXPORT: 1
BadUsage: __main__.BadUsage
file: <open file '/tmp/netconf', mode 'r' at 0x9a954a0>
getProfileList: <function getProfileList at 0x99beb8c>
switch_profile: 0
chroot: None
log: <netconfpkg.log.LogFile instance at 0xb7cace2c>
val: /tmp/netconf
filename: /tmp/netconf
devlistsdict: {'DeviceList': {'_parent': None, '_dead': 0, 'changed': False,
'data_bak': [<netconfpkg.plugins.NCDevEthernet.DevEthernet instance at
0x9a9d4cc>, <netconfpkg.plugins.NCDevEthernet.DevEthernet instance at
0x9a9d36c>], '_attributes': {'Device': {'FLAGS': [], 'TYPE': 'LIST', 'NAME':
'Device'}, 'SELF': {'NAME': 'DeviceList', 'PARENT': None, 'install_func':
<function GenClassAList_get_install_funcs at 0xb7c3e2cc>, 'FLAGS':
['ANONYMOUS'], 'CHILDKEYS': ['Device'], 'TYPE': 'LIST'}}}, 'ProfileList':
[<netconfpkg.genClass.Profile instance at 0x9ab534c>], 'HardwareList':
[<netconfpkg.plugins.NCHWEthernet.HwEthernet instance at 0x9a9d5cc>,
<netconfpkg.plugins.NCHWEthernet.HwEthernet instance at 0x9ab598c>],
'IPsecList': {'_dead': 0, 'changed': False, '_attributes': {'SELF': {'NAME':
'IPsecList', 'PARENT': None, 'install_func': <function
GenClassAList_get_install_funcs at 0xb7c3e2cc>, 'FLAGS': ['ANONYMOUS'],
'CHILDKEYS': ['IPsec'], 'TYPE': 'LIST'}, 'IPsec': {'FLAGS': [], 'TYPE': 'LIST',
'NAME': 'IPsec'}}, '_parent': None, 'oldname': None, 'data_bak': []}}
SWITCH: 3
test: 0
IMPORT: 2
opt: -f
devlists: [{'_parent': None, '_dead': 0, 'changed': False, 'data_bak':
[<netconfpkg.plugins.NCDevEthernet.DevEthernet instance at 0x9a9d4cc>,
<netconfpkg.plugins.NCDevEthernet.DevEthernet instance at 0x9a9d36c>],
'_attributes': {'Device': {'FLAGS': [], 'TYPE': 'LIST', 'NAME': 'Device'},
'SELF': {'NAME': 'DeviceList', 'PARENT': None, 'install_func': <function
GenClassAList_get_install_funcs at 0xb7c3e2cc>, 'FLAGS': ['ANONYMOUS'],
'CHILDKEYS': ['Device'], 'TYPE': 'LIST'}}},
[<netconfpkg.plugins.NCHWEthernet.HwEthernet instance at 0x9a9d5cc>,
<netconfpkg.plugins.NCHWEthernet.HwEthernet instance at 0x9ab598c>], {'_dead':
0, 'changed': False, '_attributes': {'SELF': {'NAME': 'IPsecList', 'PARENT':
None, 'install_func': <function GenClassAList_get_install_funcs at 0xb7c3e2cc>,
'FLAGS': ['ANONYMOUS'], 'CHILDKEYS': ['IPsec'], 'TYPE': 'LIST'}, 'IPsec':
{'FLAGS': [], 'TYPE': 'LIST', 'NAME': 'IPsec'}}, '_parent': None, 'oldname':
None, 'data_bak': []}, [<netconfpkg.genClass.Profile instance at 0x9ab534c>]]
args: []
progname: system-config-network-cmd
devlist: ProfileList.default.ActiveDevices.1=eth0
ProfileList.default.Activevices.2=eth1
ProfileList.default.HostsList.1.IP=127.0.0.1
ProfileList.default.HostsList.1.Hostname=localhost.localdomain
ProfileList.default.HostsList.1.AliasList.1=localhost
ProfileList.default.HostsList.1.AliasList.2=gnat1
ProfileList.default.HostsList.2.IP=::1
ProfileList.default.HostsList.2.Hostname=localhost6.localdomain6
ProfileList.default.HostsList.2.AliasList.1=localhost6
ProfileList.default.HostsList.3.IP=216.180.46.34
ProfileList.default.HostsList.3.Hostname=gnat1.hiwaay.net
ProfileList.default.HostsList.3.AliasList.1=gnat1
ProfileList.default.DNS.SecondaryDNS=
ProfileList.default.DNS.SearchList.1=hiwaay.net
ProfileList.default.DNS.Domainname=
ProfileList.default.DNS.Hostname=gnat1.hiwaay.net
ProfileList.default.DNS.TertiaryDNS=
ProfileList.default.DNS.PrimaryDNS=206.166.206.157
ProfileList.default.Active=True
ProfileList.default.ProfileName=default

key: ProfileList.default.HostsList.1.IP
vals: ['default', 'HostsList', '1', 'IP']
getIPsecList: <function getIPsecList at 0x99b633c>
line: ProfileList.default.HostsList.1.IP=127.0.0.1
e: 'str' object has no attribute '_parseLine'
clear: 1
getDeviceList: <function getDeviceList at 0x99ce0d4>
list: 0
value: 127.0.0.1
mode: 2
debug: None
do_activate: 0
os: <module 'os' from '/usr/lib/python2.5/os.pyc'>
opts: [('-i', ''), ('-c', ''), ('-f', '/tmp/netconf')]
#

Comment 1 Chris Adams 2008-01-23 14:33:25 UTC
Seeing the "fixed /etc/hosts parser" comment in the RPM changelog and that the
above appeared to be failing on the HostsList line, I tried to remove all the
HostsList lines and import.  Now it fails in a different way:

# system-config-network-cmd -i -c -f /tmp/net.new 
An unhandled exception has occured.  This is most likely a bug.
Please file a detailed bug report against the component system-config-network at 
https://bugzilla.redhat.com/bugzilla
using the text below.
Component: system-config-network
Version: 1.4.7
Summary: TB
/usr/share/system-config-network/netconfpkg/log.py:65:syslog_handler:TypeError:
[priority,] message string
Traceback (most recent call last):
  File "/usr/sbin/system-config-network-cmd", line 335, in main
    log.log(1, devlist)
  File "/usr/share/system-config-network/netconfpkg/log.py", line 72, in log
    self.handler(message, level = level)
  File "/usr/share/system-config-network/netconfpkg/log.py", line 65, in
syslog_handler
    syslog.syslog(level, string)
TypeError: [priority,] message string

Local variables in innermost frame:
syslog: <module 'syslog' from '/usr/lib/python2.5/lib-dynload/syslog.so'>
self: <netconfpkg.log.LogFile instance at 0xb7cb8e2c>
string: DeviceList.Ethernet.eth1.HardwareAddress=00:02:E3:0A:3E:2B
DeviceList.Ethernet.eth1.Type=Ethernet
DeviceList.Ethernet.eth1.BootProto=dhcp
DeviceList.Ethernet.eth1.Device=eth1
DeviceList.Ethernet.eth1.OnBoot=False
DeviceList.Ethernet.eth1.DeviceId=eth1
DeviceList.Ethernet.eth0.Hostname=gnat1.hiwaay.net
DeviceList.Ethernet.eth0.HardwareAddress=00:E0:81:20:6B:25
DeviceList.Ethernet.eth0.Type=Ethernet
DeviceList.Ethernet.eth0.BootProto=dhcp
DeviceList.Ethernet.eth0.Device=eth0
DeviceList.Ethernet.eth0.OnBoot=True
DeviceList.Ethernet.eth0.DeviceId=eth0

level: 1
# 


Comment 2 Chris Adams 2008-01-23 14:36:53 UTC
I also tried 1.5.0 from rawhide and it also failed (both on the full import and
the partial).

Comment 3 Chris Adams 2008-01-23 14:40:42 UTC
The original 1.4.3 from the F8 release does not seem to have the problem with
the HostsList entries, but it still fails with the syslog error.

Comment 4 Jiri Moskovcak 2008-01-23 14:43:57 UTC
Hi, I'm going thru the code right now, will fix this asap.

Comment 5 Jiri Moskovcak 2008-02-01 13:45:22 UTC
I fixed this in devel, if you want to try it, you can download it from http://
git.fedorahosted.org/git/system-config-network.git

Comment 6 Chris Adams 2008-02-01 16:20:29 UTC
I pulled just the patch for this issue and applied it to 1.4.7 and it does fix
the import problem.  Thanks.

Comment 7 Chris Adams 2008-03-06 14:57:07 UTC
Any chance of seeing this in an update for F8?

Comment 8 Fedora Update System 2008-04-07 14:34:25 UTC
system-config-network-1.5.5-1.fc8 has been submitted as an update for Fedora 8

Comment 9 Fedora Update System 2008-04-09 05:19:43 UTC
system-config-network-1.5.5-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update system-config-network'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-2995

Comment 10 Fedora Update System 2008-04-22 22:38:29 UTC
system-config-network-1.5.5-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.