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

Proposed by Deathzor on 2014-07-07
Status: Rejected
Rejected by: Tom Van Braeckel on 2014-12-11
Proposed branch: lp:~death-7/wicd/wicd
Merge into: lp:wicd
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
Tom Van Braeckel (community) 2014-07-07 Needs Fixing on 2014-12-11
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 on 2014-07-07
912. By Deathzor on 2014-07-07

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

Tom Van Braeckel (tomvanbraeckel) 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 on 2014-07-07

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
1=== modified file 'wicd/wnettools.py'
2--- wicd/wnettools.py 2013-02-15 21:30:48 +0000
3+++ wicd/wnettools.py 2014-07-07 16:40:40 +0000
4@@ -669,8 +669,15 @@
5 cmd = self._get_dhcp_command('connect', hostname)
6 if self.verbose:
7 print cmd
8- self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=True)
9- pipe = self.dhcp_object.stdout
10+ if self._get_dhcp_command() == misc.DHCLIENT:
11+ self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=False)
12+ #Rather Dirty but means Pipe looks the same
13+ pipe = StringIO.StringIO();
14+ pipe.write(self.dhcp_object)
15+ pipe.seek(0);
16+ else:
17+ self.dhcp_object = misc.Run(cmd, include_stderr=True, return_obj=True)
18+ pipe = self.dhcp_object.stdout
19 client_dict = { misc.DHCLIENT : self._parse_dhclient,
20 misc.DHCPCD : self._parse_dhcpcd,
21 misc.PUMP : self._parse_pump,
22@@ -683,7 +690,9 @@
23 else:
24 print "ERROR: no dhcp client found"
25 ret = None
26- self.dhcp_object.wait()
27+ #we don't wait if we set return_obj to false
28+ if self._get_dhcp_command() != misc.DHCLIENT:
29+ self.dhcp_object.wait()
30 return ret
31
32 @neediface(False)

Subscribers

People subscribed via source and target branches

to status/vote changes: