From afbe3bd63f9e347d418643953e8a1c82f625877d Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 9 Jan 2017 15:44:37 -0500 Subject: [PATCH] corrected service condition --- Makefile | 2 ++ lib/ansible/modules/system/service.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 57a9eb2de3..154b8d3eb4 100644 --- a/Makefile +++ b/Makefile @@ -48,8 +48,10 @@ endif ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1) DATE := $(shell date -j -r $(shell git log -n 1 --format="%at") +%Y%m%d%H%M) +CPUS := $(shell sysctl hw.ncpu|awk '{print $2}') else DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M) +CPUS := $(shell nproc) endif # DEB build parameters diff --git a/lib/ansible/modules/system/service.py b/lib/ansible/modules/system/service.py index f74eed1505..fd804ed739 100644 --- a/lib/ansible/modules/system/service.py +++ b/lib/ansible/modules/system/service.py @@ -626,7 +626,7 @@ class LinuxService(Service): if "stop" in cleanout: self.running = False elif "run" in cleanout: - self.running = ("not " in cleanout) + self.running = not ("not " in cleanout) elif "start" in cleanout and "not " not in cleanout: self.running = True elif 'could not access pid file' in cleanout: