Merge ~sylvain-pineau/plainbox-provider-checkbox:pm_test_remote_fix into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 45b4ffa95161e1fb80406f8fb02b96b84e20267f
Merged at revision: c261799159d320cc96fbfa124cd5fabcd4a18ba4
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:pm_test_remote_fix
Merge into: plainbox-provider-checkbox:master
Diff against target: 23 lines (+7/-5)
1 file modified
bin/pm_test (+7/-5)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+381631@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/pm_test b/bin/pm_test
2index b03e680..3dcdf28 100755
3--- a/bin/pm_test
4+++ b/bin/pm_test
5@@ -36,11 +36,13 @@ def main():
6 sys.exit(1)
7
8 # Obtain name of the invoking user.
9- uid = os.getenv('SUDO_UID') or os.getenv('PKEXEC_UID')
10- if not uid:
11- sys.stderr.write('Unable to determine invoking user\n')
12- sys.exit(1)
13- username = pwd.getpwuid(int(uid)).pw_name
14+ username = os.getenv('NORMAL_USER')
15+ if not username:
16+ uid = os.getenv('SUDO_UID') or os.getenv('PKEXEC_UID')
17+ if not uid:q
18+ sys.stderr.write('Unable to determine invoking user\n')
19+ sys.exit(1)
20+ username = pwd.getpwuid(int(uid)).pw_name
21
22 LoggingConfiguration.set(args.log_level, args.log_filename, args.append)
23 logging.debug('Invoking username: %s', username)

Subscribers

People subscribed via source and target branches