From 8358722c1096f4272873d5adbe622f20a0374060 Mon Sep 17 00:00:00 2001 From: James Laska Date: Tue, 22 Sep 2015 16:36:45 -0400 Subject: [PATCH 1/6] Fix OFFICIAL deb Makefile --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e0c5e4380f..efb7b2bdb9 100644 --- a/Makefile +++ b/Makefile @@ -518,9 +518,14 @@ deb-build: deb-build/$(DEB_TAR_NAME): dist/$(SDIST_TAR_FILE) mkdir -p $(dir $@) - tar -C deb-build/ -xvf dist/$(SDIST_TAR_FILE) - mv deb-build/$(SDIST_TAR_NAME) deb-build/$(DEB_TAR_NAME) - cd deb-build && tar czf $(DEB_TAR_FILE) $(DEB_TAR_NAME) + @if [ "$(OFFICIAL)" != "yes" ] ; then \ + tar -C deb-build/ -xvf dist/$(SDIST_TAR_FILE) ; \ + mv deb-build/$(SDIST_TAR_NAME) deb-build/$(DEB_TAR_NAME) ; \ + cd deb-build && tar czf $(DEB_TAR_FILE) $(DEB_TAR_NAME) ; \ + else \ + cp -a dist/$(SDIST_TAR_FILE) deb-build/$(DEB_TAR_FILE) ; \ + fi + cd deb-build && tar -xf $(DEB_TAR_FILE) cp -a packaging/debian deb-build/$(DEB_TAR_NAME)/ cp packaging/remove_tower_source.py deb-build/$(DEB_TAR_NAME)/debian/ sed -ie "s#^$(NAME) (\([^)]*\)) \([^;]*\);#$(NAME) ($(VERSION)-$(RELEASE)~$(DEB_DIST)) $(DEB_DIST);#" deb-build/$(DEB_TAR_NAME)/debian/changelog From d7fb9b19b1fc122cfd56e889f660d95a2964dc56 Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 23 Sep 2015 20:32:34 -0400 Subject: [PATCH 2/6] Fix reprepro/conf path in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index efb7b2bdb9..922493be40 100644 --- a/Makefile +++ b/Makefile @@ -582,8 +582,8 @@ reprepro/conf: mkdir -p $@ cp -a packaging/reprepro/* $@/ if [ "$(OFFICIAL)" = "yes" ] ; then \ - echo "ask-passphrase" >> $@/conf/options; \ - sed -i -e 's|^\(Codename:\)|SignWith: $(GPG_KEY)\n\1|' $@/conf/distributions ; \ + echo "ask-passphrase" >> $@/options; \ + sed -i -e 's|^\(Codename:\)|SignWith: $(GPG_KEY)\n\1|' $@/distributions ; \ fi reprepro: deb-build/$(DEB_NVRA).deb reprepro/conf From 949f4cb15dbea628c62fbed6c7d99f505c429c07 Mon Sep 17 00:00:00 2001 From: James Laska Date: Thu, 1 Oct 2015 12:06:01 -0400 Subject: [PATCH 3/6] Propagate necessary build changes from devel --- Makefile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 922493be40..87cba45248 100644 --- a/Makefile +++ b/Makefile @@ -68,12 +68,14 @@ DEBUILD_BIN ?= debuild DEBUILD_OPTS = --source-option="-I" DPUT_BIN ?= dput DPUT_OPTS ?= -c .dput.cf -u +REPREPRO_BIN ?= reprepro +REPREPRO_OPTS ?= -b reprepro --export=force +DEB_DIST ?= ifeq ($(OFFICIAL),yes) - DEB_DIST ?= stable # Sign official builds DEBUILD_OPTS += -k$(GPG_KEY) + REPREPRO_OPTS += --ask-passphrase else - DEB_DIST ?= unstable # Do not sign development builds DEBUILD_OPTS += -uc -us endif @@ -194,6 +196,13 @@ clean: clean-rpm clean-deb clean-grunt clean-ui clean-tar clean-packer clean-bun rm -rf build $(NAME)-$(VERSION) *.egg-info find . -type f -regex ".*\.py[co]$$" -delete +# convenience target to assert environment variables are defined +guard-%: + @if [ "${${*}}" == "" ]; then \ + echo "The required environment variable '$*' is not set"; \ + exit 1; \ + fi + # Fetch from origin, rebase local commits on top of origin commits. rebase: git pull --rebase origin master @@ -560,7 +569,7 @@ deb-build/$(DEB_NVRA).deb: deb-build/$(DEB_NVR).dsc $(PBUILDER_CACHE_DIR)/$(DEB_ $(PBUILDER_BIN) execute $(PBUILDER_OPTS) --save-after-exec packaging/pbuilder/setup.sh $(DEB_DIST) $(PBUILDER_BIN) build $(PBUILDER_OPTS) deb-build/$(DEB_NVR).dsc -deb: deb-build/$(DEB_NVRA).deb +deb: guard-DEB_DIST deb-build/$(DEB_NVRA).deb @echo "#############################################" @echo "Artifacts:" @echo deb-build/$(DEB_NVRA).deb @@ -582,17 +591,17 @@ reprepro/conf: mkdir -p $@ cp -a packaging/reprepro/* $@/ if [ "$(OFFICIAL)" = "yes" ] ; then \ - echo "ask-passphrase" >> $@/options; \ sed -i -e 's|^\(Codename:\)|SignWith: $(GPG_KEY)\n\1|' $@/distributions ; \ fi reprepro: deb-build/$(DEB_NVRA).deb reprepro/conf - reprepro --export=force -b $@ clearvanished - for COMPONENT in non-free ; do \ - reprepro --export=force -b $@ -C $$COMPONENT remove $(DEB_DIST) $(NAME) ; \ - reprepro --export=force -b $@ --keepunreferencedfiles --ignore=brokenold -C $$COMPONENT includedeb $(DEB_DIST) deb-build/$(DEB_NVRA).deb ; \ + $(REPREPRO_BIN) $(REPREPRO_OPTS) clearvanished + for COMPONENT in non-free $(VERSION); do \ + $(REPREPRO_BIN) $(REPREPRO_OPTS) -C $$COMPONENT remove $(DEB_DIST) $(NAME) ; \ + $(REPREPRO_BIN) $(REPREPRO_OPTS) -C $$COMPONENT --keepunreferencedfiles --ignore=brokenold includedeb $(DEB_DIST) deb-build/$(DEB_NVRA).deb ; \ done + # # Packer build targets # From b4ed547b2b584286fc380969a8d50ebe5000a272 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 30 Sep 2015 15:56:31 -0400 Subject: [PATCH 4/6] Fix proot controlpersist cleanup issue * Also removed psutil version and feature check from tasks. We now include the most recent version of psutil all around * Old versions of psutil must have had these Process() items as properties, they are functions now so we weren't properly evaluating them. With this change we are and things are back to working normally --- awx/plugins/callback/job_event_callback.py | 32 ++++------------------ 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/awx/plugins/callback/job_event_callback.py b/awx/plugins/callback/job_event_callback.py index 81f4a00b92..3c7a26b181 100644 --- a/awx/plugins/callback/job_event_callback.py +++ b/awx/plugins/callback/job_event_callback.py @@ -45,12 +45,7 @@ import requests # ZeroMQ import zmq -# PSUtil -try: - import psutil -except ImportError: - psutil = None - +import psutil class TokenAuth(requests.auth.AuthBase): @@ -249,19 +244,14 @@ class BaseCallbackModule(object): if not cp_files: return - # HACK: If psutil isn't available, sleep and allow the control master - # processes to timeout and die. - if not psutil: - time.sleep(60) - # Attempt to find any running control master processes. username = pwd.getpwuid(os.getuid())[0] ssh_cm_procs = [] for proc in psutil.process_iter(): try: - pname = proc.name - pcmdline = proc.cmdline - pusername = proc.username + pname = proc.name() + pcmdline = proc.cmdline() + pusername = proc.username() except psutil.NoSuchProcess: continue if pusername != username: @@ -277,19 +267,7 @@ class BaseCallbackModule(object): # version of psutil that may not have wait_procs implemented. for proc in ssh_cm_procs: proc.terminate() - if hasattr(psutil, 'wait_procs'): - procs_gone, procs_alive = psutil.wait_procs(ssh_cm_procs, timeout=5) - else: - procs_gone = [] - procs_alive = ssh_cm_procs[:] - for x in xrange(5): - for proc in procs_alive[:]: - if not proc.is_running(): - procs_alive.remove(proc) - procs_gone.append(proc) - if not procs_alive: - break - time.sleep(1) + procs_gone, procs_alive = psutil.wait_procs(ssh_cm_procs, timeout=5) for proc in procs_alive: proc.kill() From 0146b8acb0d7bfcba1f6f65260794c89f5ddafd8 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 30 Sep 2015 16:20:41 -0400 Subject: [PATCH 5/6] Remove unused time import --- awx/plugins/callback/job_event_callback.py | 1 - 1 file changed, 1 deletion(-) diff --git a/awx/plugins/callback/job_event_callback.py b/awx/plugins/callback/job_event_callback.py index 3c7a26b181..2369868c87 100644 --- a/awx/plugins/callback/job_event_callback.py +++ b/awx/plugins/callback/job_event_callback.py @@ -37,7 +37,6 @@ import logging import os import pwd import urlparse -import time # Requests import requests From 71081a5b633873ffe258b8d582413c82d64f34f3 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 1 Oct 2015 14:16:42 -0400 Subject: [PATCH 6/6] Update version to 2.3.1 and update changelog --- awx/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/__init__.py b/awx/__init__.py index 08837cdfd5..9f223d8e85 100644 --- a/awx/__init__.py +++ b/awx/__init__.py @@ -6,7 +6,7 @@ import sys import warnings import site -__version__ = '2.3.0' +__version__ = '2.3.1' __all__ = ['__version__']