From ecb164604259e309179a3c523f5dc5fc8e593718 Mon Sep 17 00:00:00 2001 From: Ozan Unsal Date: Mon, 28 Feb 2022 14:54:21 +0100 Subject: [PATCH] Fix the wrong working directory for the progress_notification script Jira: RHELCMP-7901 Signed-off-by: Ozan Unsal --- doc/messaging.rst | 5 +++-- pungi/notifier.py | 3 --- tests/test_notifier.py | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/messaging.rst b/doc/messaging.rst index 291206f2..c94ef40b 100644 --- a/doc/messaging.rst +++ b/doc/messaging.rst @@ -12,8 +12,9 @@ happened. A JSON-encoded object will be passed to standard input to provide more information about the event. At the very least, the object will contain a ``compose_id`` key. -The script is invoked in compose directory and can read other information -there. +The notification script inherits working directory from the parent process and it +can be called from the same directory ``pungi-koji`` is called from. The working directory +is listed at the start of main log. Currently these messages are sent: diff --git a/pungi/notifier.py b/pungi/notifier.py index 5eed865c..bef2ae63 100644 --- a/pungi/notifier.py +++ b/pungi/notifier.py @@ -81,9 +81,6 @@ class PungiNotifier(object): self._update_args(kwargs) - if self.compose: - workdir = self.compose.paths.compose.topdir() - with self.lock: for cmd in self.cmds: self._run_script(cmd, msg, workdir, kwargs) diff --git a/tests/test_notifier.py b/tests/test_notifier.py index 445b6ff3..914d6314 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -73,7 +73,7 @@ class TestNotifier(unittest.TestCase): stdin_data=json.dumps(data), can_fail=True, return_stdout=False, - workdir=self.compose.paths.compose.topdir.return_value, + workdir=None, universal_newlines=True, show_cmd=True, logfile=self.logfile,