summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Libosvar <libosvar@redhat.com>2015-06-12 10:39:21 +0200
committerJakub Libosvar <libosvar@redhat.com>2015-06-19 16:08:19 +0200
commit29f46a4a153733e0a15b35161d77444806b1a30b (patch)
tree82797b688700e7b5b54d8d72c5fb3e5675635a8f
parent293def2d236d60ecd265314850aaae350ef95b6a (diff)
downloadoslo-rootwrap-29f46a4a153733e0a15b35161d77444806b1a30b.tar.gz
Log that rootwrap was spawned after check
If rootwrap daemon fails to spawn then it's still logged as if it was spawned due to process is wrapped by sudo that is actually spawned. That is confusing when debugging. This patch moves the logging message after it's re-checked whether process was actually spawned. Change-Id: I1b60e727e5dc90335dabf96877a60e685b7e9a2d
-rw-r--r--oslo_rootwrap/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/oslo_rootwrap/client.py b/oslo_rootwrap/client.py
index cb01ce6..0c3a500 100644
--- a/oslo_rootwrap/client.py
+++ b/oslo_rootwrap/client.py
@@ -72,8 +72,8 @@ class Client(object):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- LOG.info("Spawned new rootwrap daemon process with pid=%d",
- process_obj.pid)
+ LOG.debug("Popen for %s command has been instantiated",
+ self._start_command)
self._process = process_obj
socket_path = process_obj.stdout.readline()[:-1]
@@ -86,6 +86,8 @@ class Client(object):
# NOTE(yorik-sar): don't expose stdout here
raise Exception("Failed to spawn rootwrap process.\nstderr:\n%s" %
(stderr,))
+ LOG.info("Spawned new rootwrap daemon process with pid=%d",
+ process_obj.pid)
self._manager = ClientManager(socket_path, authkey)
self._manager.connect()
self._proxy = self._manager.rootwrap()