Add support for LTTNG_UST_HOME
[lttng-ust.git] / src / python-lttngust / lttngust / agent.py
index 8658372819c5e5cd60e6412ac2e26db3a62e6a56..b99293424aac705728c13c47716b5b9f516951ab 100644 (file)
@@ -96,7 +96,7 @@ class _TcpClient(object):
             except (Exception) as e:
                 # Whatever happens here, we have to close the socket and
                 # retry to connect to the session daemon since either
-                # the socket was closed, a network timeout occured, or
+                # the socket was closed, a network timeout occurred, or
                 # invalid data was received.
                 dbg._pdebug(self._debug('got exception: {}'.format(e)))
                 self._cleanup_socket()
@@ -268,8 +268,10 @@ def _get_port_from_file(path):
 
 
 def _get_user_home_path():
-    # $LTTNG_HOME overrides $HOME if it exists
-    return os.getenv('LTTNG_HOME', os.path.expanduser('~'))
+    # $LTTNG_UST_HOME overrides $LTTNG_HOME if it exist.
+    # In turn, $LTTNG_HOME overrides $HOME if it exists
+    return os.getenv('LTTNG_UST_HOME', os.getenv('LTTNG_HOME',
+        os.path.expanduser('~')))
 
 
 _initialized = False
This page took 0.023459 seconds and 4 git commands to generate.