Merge lp:~death-7/wicd/wicd into lp:wicd/1.6

Proposed by Deathzor
Status: Rejected
Rejected by: Pieter Leclerc
Proposed branch: lp:~death-7/wicd/wicd
Merge into: lp:wicd/1.6
Diff against target: 32 lines (+12/-3)
1 file modified
wicd/wnettools.py (+12/-3)
To merge this branch: bzr merge lp:~death-7/wicd/wicd
Reviewer Review Type Date Requested Status
Pieter Leclerc (community) Needs Fixing
Review via email: mp+225865@code.launchpad.net

Description of the change

Minor bug fix ( affecting gentoo dhclient users )

To post a comment you must log in.
lp:~death-7/wicd/wicd updated
912. By Deathzor

Changed return_obj to False when running dhclient ( to prevent dhclient
trying to read stdin as a config file )

Revision history for this message
Pieter Leclerc (pieterleclerc-deactivatedaccount) :
Revision history for this message
Pieter Leclerc (pieterleclerc-deactivatedaccount) wrote :

I added some inline notes about what, in my opinion, needs fixing.

I'm a bit skeptical about the "hacky" nature of the changes, so it would be great if you could elaborate on that a bit, about why dhclient reads from STDIN on Gentoo... I am using it as well and I don't notice any problems, so why is Gentoo's dhclient different?

Please improve, thanks a lot in advance, and we'll merge it!

review: Needs Fixing

Unmerged revisions

912. By Deathzor

Changed return_obj to False when running dhclient ( to prevent dhclient
trying to read stdin as a config file )

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'wicd/wnettools.py'
--- wicd/wnettools.py 2013-02-15 21:30:48 +0000
+++ wicd/wnettools.py 2014-07-07 16:40:40 +0000
@@ -669,8 +669,15 @@
669 cmd = self._get_dhcp_command('connect', hostname)669 cmd = self._get_dhcp_command('connect', hostname)
670 if self.verbose:670 if self.verbose:
671 print cmd671 print cmd
672 self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=True)672 if self._get_dhcp_command() == misc.DHCLIENT:
673 pipe = self.dhcp_object.stdout673 self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=False)
674 #Rather Dirty but means Pipe looks the same
675 pipe = StringIO.StringIO();
676 pipe.write(self.dhcp_object)
677 pipe.seek(0);
678 else:
679 self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=True)
680 pipe = self.dhcp_object.stdout
674 client_dict = { misc.DHCLIENT : self._parse_dhclient,681 client_dict = { misc.DHCLIENT : self._parse_dhclient,
675 misc.DHCPCD : self._parse_dhcpcd,682 misc.DHCPCD : self._parse_dhcpcd,
676 misc.PUMP : self._parse_pump,683 misc.PUMP : self._parse_pump,
@@ -683,7 +690,9 @@
683 else:690 else:
684 print "ERROR: no dhcp client found"691 print "ERROR: no dhcp client found"
685 ret = None692 ret = None
686 self.dhcp_object.wait()693 #we don't wait if we set return_obj to false
694 if self._get_dhcp_command() != misc.DHCLIENT:
695 self.dhcp_object.wait()
687 return ret696 return ret
688 697
689 @neediface(False)698 @neediface(False)

Subscribers

People subscribed via source and target branches

to status/vote changes: