Bug 501530 - system-config-network removes the file route-eth<X> upon save
system-config-network removes the file route-eth<X> upon save
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: system-config-network (Show other bugs)
5.3
All Linux
low Severity low
: rc
: ---
Assigned To: Harald Hoyer
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-19 11:32 EDT by Olivier Fourdan
Modified: 2013-03-03 21:48 EST (History)
7 users (show)

See Also:
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 01:09:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Olivier Fourdan 2009-05-19 11:32:05 EDT
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 02:33:49 EDT
yes, bug. Easily fixable.
Comment 4 RHEL Product and Program Management 2009-11-06 13:47:02 EST
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 01:09:21 EST
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.