Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 501530

Summary: system-config-network removes the file route-eth<X> upon save
Product: Red Hat Enterprise Linux 5 Reporter: Olivier Fourdan <ofourdan>
Component: system-config-networkAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 5.3CC: azelinka, dmair, jmarko, jpopelka, kem, pknirsch, psklenar
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: system-config-network-1.3.99.20-1.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:09:21 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 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