aboutsummaryrefslogtreecommitdiff
path: root/nxdialog
diff options
context:
space:
mode:
authorUlrich Sibiller <ulrich.sibiller@atos.net>2019-03-01 10:50:16 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-03-01 12:48:32 +0100
commit07052a25c0295806b50cf52191f98986b40e8b38 (patch)
treebc68658668a328656a8b5191ddacb1ff22c5c571 /nxdialog
parentacffe15b58c352914a63499d29a12f72671afc5b (diff)
downloadnx-libs-07052a25c0295806b50cf52191f98986b40e8b38.tar.gz
nx-libs-07052a25c0295806b50cf52191f98986b40e8b38.tar.bz2
nx-libs-07052a25c0295806b50cf52191f98986b40e8b38.zip
nxdialog: allow to provide --parent 0 for testing
Agent PID 0 can be used for testing
Diffstat (limited to 'nxdialog')
-rwxr-xr-xnxdialog/nxdialog8
1 files changed, 5 insertions, 3 deletions
diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog
index 58e773ca8..d3a7c0bb0 100755
--- a/nxdialog/nxdialog
+++ b/nxdialog/nxdialog
@@ -234,11 +234,13 @@ def handle_session_action(agentpid, action):
if action == DISCONNECT:
print("Disconnecting from session, sending SIGHUP to %s" % (agentpid))
- os.kill(agentpid, signal.SIGHUP)
+ if agentpid != 0:
+ os.kill(agentpid, signal.SIGHUP)
elif action == TERMINATE:
print("Terminating session, sending SIGTERM to process %s" % (agentpid))
- os.kill(agentpid, signal.SIGTERM)
+ if agentpid != 0:
+ os.kill(agentpid, signal.SIGTERM)
elif action is None:
pass
@@ -339,7 +341,7 @@ class NxDialogProgram(object):
if dlgtype in (DLG_TYPE_PULLDOWN,
DLG_TYPE_YESNOSUSPEND,
- DLG_TYPE_YESNO) and not self.options.agentpid:
+ DLG_TYPE_YESNO) and self.options.agentpid is None:
sys.stderr.write("Agent pid not supplied via --parent\n")
sys.exit(EXIT_FAILURE)