summaryrefslogtreecommitdiff
path: root/src/leap/bitmask
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-01-19 14:34:22 -0400
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-01-30 13:11:44 -0300
commitc85f44d63ca040eed5963abcf27cf6e81e84a38b (patch)
treee626b4cf5b2bcfd10d40396042983451165300e2 /src/leap/bitmask
parentf7357bb1960ce11d85d0a2f2d70b3fe51d5b6dc7 (diff)
fix path for gnome polkit agent (Closes: #6652)feature/async-api
fix also a typo when logging errors
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r--src/leap/bitmask/util/polkit_agent.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/leap/bitmask/util/polkit_agent.py b/src/leap/bitmask/util/polkit_agent.py
index 78eeaa55..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 = (
'/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()