Merge ~jocave/checkbox-support:pulse-use-from-snaps into checkbox-support:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: ecfd1f71db328a0f7c7d4b06c6b7ecca55c3b939
Merged at revision: 22f28b0bfd21102be78bbe7ad947728c08ed2fd9
Proposed branch: ~jocave/checkbox-support:pulse-use-from-snaps
Merge into: checkbox-support:master
Diff against target: 30 lines (+6/-1)
1 file modified
checkbox_support/scripts/audio_settings.py (+6/-1)
Reviewer Review Type Date Requested Status
Sheila Miguez (community) Approve
Review via email: mp+389084@code.launchpad.net

Description of the change

Same change as made in:

https://code.launchpad.net/~jocave/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/388884

As this script also makes `pactl` calls the runtime path needs fixing when running from a snap

To post a comment you must log in.
Revision history for this message
Sheila Miguez (codersquid) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/checkbox_support/scripts/audio_settings.py b/checkbox_support/scripts/audio_settings.py
index f850e5a..6c00743 100644
--- a/checkbox_support/scripts/audio_settings.py
+++ b/checkbox_support/scripts/audio_settings.py
@@ -1,7 +1,7 @@
1#1#
2# This file is part of Checkbox.2# This file is part of Checkbox.
3#3#
4# Copyright 2013 Canonical Ltd.4# Copyright 2013-2020 Canonical Ltd.
5#5#
6# Checkbox is free software: you can redistribute it and/or modify6# Checkbox is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 3,7# it under the terms of the GNU General Public License version 3,
@@ -31,6 +31,7 @@ import re
31import sys31import sys
3232
33from checkbox_support.parsers.pactl import parse_pactl_output33from checkbox_support.parsers.pactl import parse_pactl_output
34from checkbox_support.snap_utils.system import in_classic_snap
3435
35TYPES = ("source", "sink")36TYPES = ("source", "sink")
36DIRECTIONS = {"source": "input", "sink": "output"}37DIRECTIONS = {"source": "input", "sink": "output"}
@@ -54,6 +55,10 @@ def unlocalized_env(reset={"LANG": "POSIX.UTF-8"}):
54 """55 """
55 env = dict(os.environ)56 env = dict(os.environ)
56 env.update(reset)57 env.update(reset)
58 if in_classic_snap():
59 prp = '/run/user/{}/snap.{}/../pulse'.format(
60 os.geteuid(), os.getenv('SNAP_NAME'))
61 env['PULSE_RUNTIME_PATH'] = prp
57 return env62 return env
5863
5964

Subscribers

People subscribed via source and target branches