Bug 501530 - system-config-network removes the file route-eth<X> upon save
Summary: system-config-network removes the file route-eth<X> upon save
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: system-config-network
Version: 5.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Harald Hoyer
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-19 15:32 UTC by Olivier Fourdan
Modified: 2018-11-14 20:04 UTC (History)
7 users (show)

Fixed In Version: system-config-network-1.3.99.20-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-21 06:09:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0231 0 normal SHIPPED_LIVE system-config-network bug fix and enhancement update 2012-02-20 15:07:45 UTC

Description Olivier Fourdan 2009-05-19 15:32:05 UTC
Description of problem:

system-config-network uses the file route-${DeviceId} to save static routes defined in GUI.

However, that file may contain old custom style and system-config-network will remove the file upon save even if the route has not been modified in the GUI.

Version-Release number of selected component (if applicable):

system-config-network-1.3.99.12-1.el5

How reproducible:

100% reproducible

Steps to Reproduce:
1. Create a "/etc/sysconfig/network-scripts/route-eth0" with options that system-config-network does not parse

   192.168.1.1/24 dev eth0 table 2
   default via 192.168.254 table 2 

2. Run system-config-network, modify a param for eth0 leaving the route untouched

3. Save
  
Actual results:

/etc/sysconfig/network-scripts/route-eth0 is removed

Expected results:

/etc/sysconfig/network-scripts/route-eth0 is left untouched

Additional info:

The file is removed NCDevice.py is save() by this portion of code:

260     def save( self ):
       [...]
370
371         # FIXME: RFE [174974] limitation of setting routing
372         if self.StaticRoutes and len( self.StaticRoutes ) > 0:
373             rconf = ConfRoute( self.DeviceId )
374             for key in rconf.keys():
375                 del rconf[key]
376             p = 0
377             for route in self.StaticRoutes:
378                 if route.Address:
379                     rconf['ADDRESS'+str( p )] = route.Address
380                 if route.Netmask:
381                     rconf['NETMASK'+str( p )] = route.Netmask
382                 if route.Gateway:
383                     rconf['GATEWAY'+str( p )] = route.Gateway
384                 p = p + 1
385             rconf.write()
386         else:
387             # remove route file, if no routes defined
388             unlink( netconfpkg.ROOT + SYSCONFDEVICEDIR + self.DeviceId + '.route' )
389             unlink( netconfpkg.ROOT + SYSCONFDEVICEDIR + 'route-' + self.DeviceId )
390

As system-config-network has not parsed the existing option in the route-eth0 file, self.StaticRoutes is empty and therefore the unlink in invoked.

Comment 1 Harald Hoyer 2009-05-20 06:33:49 UTC
yes, bug. Easily fixable.

Comment 4 RHEL Program Management 2009-11-06 18:47:02 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 21 errata-xmlrpc 2012-02-21 06:09:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0231.html


Note You need to log in before you can comment on or make changes to this bug.