From 5fe889c7f19d737c215dfa3d0a1a55aabc472d5a Mon Sep 17 00:00:00 2001 From: Mike Place Date: Fri, 10 Jun 2016 10:34:24 -0600 Subject: [PATCH] Don't call os.getppid() on Windows Fixes #33927 --- salt/utils/parsers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 2f7322d456..de996c9301 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -912,8 +912,13 @@ class DaemonMixIn(six.with_metaclass(MixInMeta, object)): ''' if self.check_pidfile(): pid = self.get_pidfile() - if self.check_pidfile() and self.is_daemonized(pid) and not os.getppid() == pid: - return True + if not salt.utils.is_windows(): + if self.check_pidfile() and self.is_daemonized(pid) and not os.getppid() == pid: + return True + else: + # We have no os.getppid() on Windows. Best effort. + if self.check_pidfile() and self.is_daemonized(pid): + return True return False def is_daemonized(self, pid):