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 > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 10-01-2010, 04:01 PM
Radek Vykydal
 
Default Honor selected hostname on Live CD (#638634)

NetworkManager on liveCD doesn't use ifcfg files, so we don't
see any devices to be configured in anaconda (which is OK),
but we still offer hostname choice, so honor it.
---
pyanaconda/network.py | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index ae06f1e..d12d8ac 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -446,6 +446,22 @@ class Network:
else:
self.netdevices[device].set(('GATEWAY', gw))

+ @property
+ def gateway(self):
+ """GATEWAY - last device in list wins"""
+ gw = ""
+ for dev in self.netdevices.values():
+ gw = dev.get('GATEWAY')
+ return gw
+
+ @property
+ def ipv6_defaultgw(self):
+ """IPV6_DEFAULTGW - last device in list wins"""
+ gw = ""
+ for dev in self.netdevices.values():
+ gw = dev.get('IPV6_DEFAULTGW')
+ return gw
+
def lookupHostname(self):
# can't look things up if they don't exist!
if not self.hostname or self.hostname == "localhost.localdomain":
@@ -630,9 +646,6 @@ class Network:

def copyConfigToPath(self, instPath='):

- if len(self.netdevices) == 0:
- return
-
# /etc/sysconfig/network-scripts/ifcfg-DEVICE
# /etc/sysconfig/network-scripts/keys-DEVICE
# /etc/dhcp/dhclient-DEVICE.conf
@@ -674,9 +687,6 @@ class Network:

devices = self.netdevices.values()

- if len(devices) == 0:
- return
-
# /etc/sysconfig/network-scripts/ifcfg-*
# /etc/sysconfig/network-scripts/keys-*
for dev in devices:
@@ -707,11 +717,11 @@ class Network:
else:
f.write("localhost.localdomain
")

- if dev.get('GATEWAY'):
- f.write("GATEWAY=%s
" % (dev.get('GATEWAY'),))
+ if self.gateway:
+ f.write("GATEWAY=%s
" % self.gateway)

- if dev.get('IPV6_DEFAULTGW'):
- f.write("IPV6_DEFAULTGW=%s
" % (dev.get('IPV6_DEFAULTGW'),))
+ if self.ipv6_defaultgw:
+ f.write("IPV6_DEFAULTGW=%s
" % self.ipv6_defaultgw)

f.close()
shutil.move(newnetwork, networkConfFile)
--
1.7.2

_______________________________________________
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 12:09 AM.

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