From e47d6f6cfe72e02310b5be637a6cbb242769dce2 Mon Sep 17 00:00:00 2001 From: Bharat Kunwar Date: Wed, 28 Aug 2019 13:26:02 +0000 Subject: [PATCH] Readable heat-container-agent log The output of heat-container-agent has become unreadable. This patch aims to address this in order to make debugging easier. Additionally, this patch also adds missing dependencies in the most recent fedora:rawhide (32) image. Task: 36392 Story: 2006463 Change-Id: I54180b96357f6fa6d4044d818740ae70e036e435 --- dockerfiles/heat-container-agent/Dockerfile | 4 ++++ dockerfiles/heat-container-agent/scripts/55-heat-config | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dockerfiles/heat-container-agent/Dockerfile b/dockerfiles/heat-container-agent/Dockerfile index b9e1cd80c7..76402f1ee0 100644 --- a/dockerfiles/heat-container-agent/Dockerfile +++ b/dockerfiles/heat-container-agent/Dockerfile @@ -16,9 +16,11 @@ RUN dnf -y --setopt=tsflags=nodocs --nogpgcheck install \ findutils \ gcc \ kubernetes-client \ + libffi-devel \ openssh-clients \ openssl \ python-devel \ + python-lxml \ python-pip \ python-psutil \ redhat-rpm-config && \ @@ -55,6 +57,8 @@ RUN /tmp/write-os-apply-config-templates.sh COPY manifest.json service.template config.json.template tmpfiles.template /exports/ +RUN ln -s /usr/bin/python3 /usr/bin/python + COPY launch /usr/bin/start-heat-container-agent # Execution diff --git a/dockerfiles/heat-container-agent/scripts/55-heat-config b/dockerfiles/heat-container-agent/scripts/55-heat-config index 4dd96b448e..c7df3c422a 100755 --- a/dockerfiles/heat-container-agent/scripts/55-heat-config +++ b/dockerfiles/heat-container-agent/scripts/55-heat-config @@ -149,9 +149,6 @@ def invoke_hook(c, log): stdout, stderr = subproc.communicate( input=json.dumps(c).encode('utf-8', 'replace')) - log.info(stdout) - log.debug(stderr) - if subproc.returncode: log.error("Error running %s. [%s]\n" % ( hook_path, subproc.returncode)) @@ -168,6 +165,10 @@ def invoke_hook(c, log): 'deploy_status_code': subproc.returncode, } + for i in signal_data.items(): + log.info('%s\n%s' % i) + log.debug(stderr.decode('utf-8', 'replace')) + signal_data_path = os.path.join(DEPLOYED_DIR, '%s.notify.json' % c['id']) # write out notify data for debugging with os.fdopen(os.open(