Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 211869 Details for
Bug 295468
net-misc/wicd-1.7.0_alpha1 fails resolving hostname
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
478_477.diff (text/plain), 4.11 KB, created by
Sergey Ovcharenko
on 2009-12-03 16:13:53 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Sergey Ovcharenko
Created:
2009-12-03 16:13:53 UTC
Size:
4.11 KB
patch
obsolete
>=== modified file 'wicd/networking.py' >--- wicd/networking.py 2009-11-24 05:27:41 +0000 >+++ wicd/networking.py 2009-11-26 05:01:07 +0000 >@@ -448,6 +448,8 @@ > else: > # Run dhcp... > self.SetStatus('running_dhcp') >+ if self.network.get('dhcphostname') == None: >+ self.network['dhcphostname'] = os.uname()[1] > print "Running DHCP with hostname",self.network["dhcphostname"] > dhcp_status = iface.StartDHCP(self.network["dhcphostname"]) > if dhcp_status in ['no_dhcp_offers', 'dhcp_failed']: > >=== modified file 'wicd/wnettools.py' >--- wicd/wnettools.py 2009-11-23 17:43:50 +0000 >+++ wicd/wnettools.py 2009-11-26 05:01:07 +0000 >@@ -270,10 +270,16 @@ > client = None > cmd = "" > return (client, cmd) >+ >+ # probably /var/lib/wicd/dhclient.conf with defaults >+ dhclient_conf_path = os.path.join( >+ wpath.varlib, >+ 'dhclient.conf' >+ ) > > client_dict = { > "dhclient" : >- {'connect' : r"%(cmd)s %(iface)s", >+ {'connect' : r"%(cmd)s -cf %(dhclientconf)s %(iface)s", > 'release' : r"%(cmd)s -r %(iface)s", > 'id' : misc.DHCLIENT, > }, >@@ -294,12 +300,41 @@ > }, > } > (client_name, cmd) = get_client_name(self.DHCP_CLIENT) >+ >+ # cause dhclient doesn't have a handy dandy argument >+ # for specifing the hostname to be sent >+ if client_name == "dhclient" and flavor: >+ if hostname == None: >+ # <hostname> will use the system hostname >+ # we'll use that if there is hostname passed >+ # that shouldn't happen, though >+ hostname = '<hostname>' >+ print 'attempting to set hostname with dhclient' >+ print 'using dhcpcd or another supported client may work better' >+ dhclient_template = \ >+ open(os.path.join(wpath.etc, 'dhclient.conf.template'), 'r') >+ >+ output_conf = open(dhclient_conf_path, 'w') >+ >+ for line in dhclient_template.readlines(): >+ line = line.replace('$_HOSTNAME', hostname) >+ output_conf.write(line) >+ >+ output_conf.close() >+ dhclient_template.close() >+ > if not client_name or not cmd: > print "WARNING: Failed to find a valid dhcp client!" > return "" > > if flavor == "connect": >- return client_dict[client_name]['connect'] % {"cmd":cmd, "iface":self.iface, "hostname":hostname} >+ if not hostname: >+ hostname = os.uname()[1] >+ return client_dict[client_name]['connect'] % \ >+ { "cmd" : cmd, >+ "iface" : self.iface, >+ "hostname" : hostname, >+ 'dhclientconf' : dhclient_conf_path } > elif flavor == "release": > return client_dict[client_name]['release'] % {"cmd":cmd, "iface":self.iface} > else: >@@ -535,7 +570,7 @@ > def _check_dhcp_result(self, success): > """ Print and return the correct DHCP connection result. > >- Keyword Arguents: >+ Keyword Arguments: > success -- boolean specifying if DHCP was succesful. > > Returns: >@@ -550,15 +585,18 @@ > return 'dhcp_failed' > > @neediface(False) >- def StartDHCP(self,hostname): >+ def StartDHCP(self, hostname): > """ Start the DHCP client to obtain an IP address. >+ >+ Keyword Arguments: >+ hostname -- the hostname to send to the DHCP server > > Returns: > A string representing the result of the DHCP command. See > _check_dhcp_result for the possible values. > > """ >- cmd = self._get_dhcp_command('connect',hostname) >+ cmd = self._get_dhcp_command('connect', hostname) > if self.verbose: print cmd > self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=True) > pipe = self.dhcp_object.stdout >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 295468
: 211869 |
211872