FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 04-27-2010, 08:49 AM
Radek Vykydal
 
Default Do not mess value change with line formatting (#520146)

Format the line only at single place, and when modifying value
of parameter to be written-out, change also its value in the
NetworkDevice object accordingly.
---
network.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/network.py b/network.py
index a7c474e..24f029d 100644
--- a/network.py
+++ b/network.py
@@ -286,12 +286,14 @@ class NetworkDevice(IfcfgFile):
keys.remove("KEY")
if iutil.isS390() and ("HWADDR" in keys):
keys.remove("HWADDR")
+ # make sure we include autoneg in the ethtool line
+ if 'ETHTOOL_OPTS' in keys:
+ eopts = self.get('ETHTOOL_OPTS')
+ if "autoneg" not in eopts:
+ self.set(('ETHTOOL_OPTS', "autoneg off %s" % eopts))

for key in keys:
- # make sure we include autoneg in the ethtool line
- if key == 'ETHTOOL_OPTS' and self.info[key].find("autoneg")== -1:
- s = s + key + """="autoneg off %s"
""" % (self.info[key])
- elif self.info[key] is not None:
+ if self.info[key] is not None:
s = s + key + '="' + self.info[key] + '"
'

return s
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org