Merge lp://staging/~adamblackburn/wicd/loggroup into lp://staging/wicd/1.6

Proposed by Adam Blackburn
Status: Merged
Approved by: Dan O'Reilly
Approved revision: 418
Merged at revision: not available
Proposed branch: lp://staging/~adamblackburn/wicd/loggroup
Merge into: lp://staging/wicd/1.6
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~adamblackburn/wicd/loggroup
Reviewer Review Type Date Requested Status
Dan O'Reilly Approve
Wicd-devel Pending
Review via email: mp+7504@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Adam Blackburn (adamblackburn) wrote :

This enables the --loggroup and --logperm arguments to setup.py configure. Thanks to David Paleino for patch.

416. By Adam Blackburn

removed wicd-daemon.py from .bzrignore

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

In wpath.py.in log_group and log_perms are used. But in wicd-daemon.py wpath.loggroup and wpath.logperms are used, which won't work.

The try/except that the chmod/chown happen in should be split into one where the chmod happens and another one where the chown happens, so we can tell what actually failed if we get an exception doing one of them.

Revision history for this message
Dan O'Reilly (oreilldf) :
review: Needs Fixing
417. By Adam Blackburn

added forgotten underscores

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

Fixed, sorry about that.

418. By Adam Blackburn

seperated chmod and chown try/excepts

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

I've changed it so that the chown/chmod try/excepts are separated. Let me know if there are any other problems :)

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2009-02-27 05:08:31 +0000
3+++ .bzrignore 2009-06-13 20:59:03 +0000
4@@ -22,5 +22,6 @@
5 scripts/wicd-client
6 scripts/wicd-curses
7 translations/*
8+wicd/wicd-daemon.py
9 wicd/wpath.py
10 *tags
11
12=== modified file 'in/wicd=wpath.py.in'
13--- in/wicd=wpath.py.in 2009-05-05 02:34:44 +0000
14+++ in/wicd=wpath.py.in 2009-06-13 20:59:03 +0000
15@@ -62,6 +62,8 @@
16 # stores only the file name, i.e. wicd
17 initfilename = '%INITFILENAME%'
18 wicd_group = '%WICDGROUP%'
19+log_group = '%LOGGROUP%'
20+log_perms = '%LOGPERMS%'
21
22 # BOOLEANS
23 no_install_pmutils = %NO_INSTALL_PMUTILS%
24
25=== modified file 'setup.py'
26--- setup.py 2009-06-04 14:24:14 +0000
27+++ setup.py 2009-06-13 20:59:03 +0000
28@@ -242,6 +242,8 @@
29 self.no_install_acpi = True
30 elif self.distro in ['debian']:
31 self.wicdgroup = "netdev"
32+ self.loggroup = "adm"
33+ self.logperms = "0640"
34 self.init = '/etc/init.d/'
35 self.initfile = 'init/debian/wicd'
36 elif self.distro in ['arch']:
37
38=== modified file 'wicd/wicd-daemon.py'
39--- wicd/wicd-daemon.py 2009-05-24 21:11:14 +0000
40+++ wicd/wicd-daemon.py 2009-06-16 15:08:52 +0000
41@@ -1671,9 +1671,13 @@
42 output = ManagedStdio(logpath)
43 if os.path.exists(logpath):
44 try:
45- os.chmod(logpath, 0600)
46+ os.chmod(logpath, wpath.logperms)
47+ if wpath.loggroup:
48+ import grp
49+ group = grp.getgrnam(wpath.loggroup)
50+ os.chown(logpath, 0, group[2])
51 except:
52- print 'unable to chmod log file to 0600'
53+ print 'unable to chmod log file to %s' % wpath.logperms
54
55 if redirect_stdout: sys.stdout = output
56 if redirect_stderr: sys.stderr = output

Subscribers

People subscribed via source and target branches

to status/vote changes: