diff options
author | Kali Kaneko <kali@leap.se> | 2015-02-05 15:22:37 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-02-05 15:22:37 -0400 |
commit | 8de591e85db21c8a189336c630408abdf7c85b1b (patch) | |
tree | 82d9fd7daebe5ee0a1bd5d099e8249ca97340508 /src/leap/bitmask/util/polkit_agent.py | |
parent | e2043a930b9ef98ad68746a2f21585901117892a (diff) | |
parent | 1fa295ecd6af5c2ea64e76418bd144f9ddf4c803 (diff) |
Merge tag '0.8.0' into debian/experimental
Tag leap.bitmask version 0.8.0
Conflicts:
pkg/requirements.pip
src/leap/bitmask/gui/mainwindow.py
Diffstat (limited to 'src/leap/bitmask/util/polkit_agent.py')
-rw-r--r-- | src/leap/bitmask/util/polkit_agent.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/leap/bitmask/util/polkit_agent.py b/src/leap/bitmask/util/polkit_agent.py index af5e431c..e512bffa 100644 --- a/src/leap/bitmask/util/polkit_agent.py +++ b/src/leap/bitmask/util/polkit_agent.py @@ -23,22 +23,18 @@ import subprocess import daemon +# TODO --- logger won't work when daemoninzed. Log to syslog instead? logger = logging.getLogger(__name__) -AUTH_FILE = "polkit-%s-authentication-agent-1" -BASE_PATH_GNO = "/usr/lib/policykit-1-gnome/" -BASE_PATH_KDE = "/usr/lib/kde4/libexec/" -GNO_PATH = BASE_PATH_GNO + AUTH_FILE % ("gnome",) -KDE_PATH = BASE_PATH_KDE + AUTH_FILE % ("kde",) - -POLKIT_PATHS = { +POLKIT_PATHS = ( '/usr/lib/lxpolkit/lxpolkit', - '/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1', + '/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1', '/usr/lib/mate-polkit/polkit-mate-authentication-agent-1', '/usr/lib/kde4/libexec/polkit-kde-authentication-agent-1', -} +) +# TODO write tests for this piece. def _get_polkit_agent(): """ Return a valid polkit agent to use. @@ -62,7 +58,7 @@ def _launch_agent(): polkit_agent = _get_polkit_agent() if polkit_agent is None: - logger.erro("No usable polkit was found.") + logger.error("No usable polkit was found.") return logger.debug('Launching polkit auth agent') @@ -81,4 +77,6 @@ def launch(): _launch_agent() if __name__ == "__main__": + # TODO pass a --nodaemon flag so that we can launch this in the foreground + # and debug this module, getting errors to stderr. launch() |