aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkyKnight <18136365+SkyKnightSKS@users.noreply.github.com>2023-07-28 18:48:14 +0200
committerGitHub <noreply@github.com>2023-07-28 12:48:14 -0400
commite9534d6f927ea6ef20c38ec4da4a4f3c10eddb84 (patch)
treec97836e2630836091eb4db090214f00a0cf5a428
parentba4eed175df761e42ce2d6eb2692b82d8d1c779a (diff)
downloadkutter-e9534d6f927ea6ef20c38ec4da4a4f3c10eddb84.tar.gz
kutter-e9534d6f927ea6ef20c38ec4da4a4f3c10eddb84.tar.xz
kutter-e9534d6f927ea6ef20c38ec4da4a4f3c10eddb84.zip
webhooks: Add process id, user id and group id to the info endpoint. (#6284)
Signed-off-by: Gregoire Mbutilovich <skyknight_x@hotmail.com>
-rw-r--r--klippy/webhooks.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/klippy/webhooks.py b/klippy/webhooks.py
index 9188a4f7..bccc5aac 100644
--- a/klippy/webhooks.py
+++ b/klippy/webhooks.py
@@ -354,9 +354,14 @@ class WebHooks:
state_message, state = self.printer.get_state_message()
src_path = os.path.dirname(__file__)
klipper_path = os.path.normpath(os.path.join(src_path, ".."))
- response = {'state': state, 'state_message': state_message,
+ response = {'state': state,
+ 'state_message': state_message,
'hostname': socket.gethostname(),
- 'klipper_path': klipper_path, 'python_path': sys.executable}
+ 'klipper_path': klipper_path,
+ 'python_path': sys.executable,
+ 'process_id': os.getpid(),
+ 'user_id': os.getuid(),
+ 'group_id': os.getgid()}
start_args = self.printer.get_start_args()
for sa in ['log_file', 'config_file', 'software_version', 'cpu_info']:
response[sa] = start_args.get(sa)