Merge "Readable heat-container-agent log"

This commit is contained in:
Zuul 2019-09-03 09:42:04 +00:00 committed by Gerrit Code Review
commit f35f931a6c
2 changed files with 8 additions and 3 deletions

View File

@ -16,9 +16,11 @@ RUN dnf -y --setopt=tsflags=nodocs --nogpgcheck install \
findutils \ findutils \
gcc \ gcc \
kubernetes-client \ kubernetes-client \
libffi-devel \
openssh-clients \ openssh-clients \
openssl \ openssl \
python-devel \ python-devel \
python-lxml \
python-pip \ python-pip \
python-psutil \ python-psutil \
redhat-rpm-config && \ 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/ 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 COPY launch /usr/bin/start-heat-container-agent
# Execution # Execution

View File

@ -149,9 +149,6 @@ def invoke_hook(c, log):
stdout, stderr = subproc.communicate( stdout, stderr = subproc.communicate(
input=json.dumps(c).encode('utf-8', 'replace')) input=json.dumps(c).encode('utf-8', 'replace'))
log.info(stdout)
log.debug(stderr)
if subproc.returncode: if subproc.returncode:
log.error("Error running %s. [%s]\n" % ( log.error("Error running %s. [%s]\n" % (
hook_path, subproc.returncode)) hook_path, subproc.returncode))
@ -168,6 +165,10 @@ def invoke_hook(c, log):
'deploy_status_code': subproc.returncode, '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']) signal_data_path = os.path.join(DEPLOYED_DIR, '%s.notify.json' % c['id'])
# write out notify data for debugging # write out notify data for debugging
with os.fdopen(os.open( with os.fdopen(os.open(