From 1ca260e6631bf2fd730b6eea205acf18b97038c0 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 8 Nov 2019 10:22:43 +0100 Subject: [PATCH] Fix for status checks in check command --- osclib/check_command.py | 18 ++++++++++-------- osclib/stagingapi.py | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osclib/check_command.py b/osclib/check_command.py index 41146d14..1a4f0914 100644 --- a/osclib/check_command.py +++ b/osclib/check_command.py @@ -57,10 +57,12 @@ class CheckCommand(object): report.append(' - Missing check: ' + check.get('name')) for check in project.findall('checks/*'): - if check.get('state') != 'success': - info = " - %s check: %s" % (check.get('state'), check.get('name')) - if check.get('url'): - info += " " + check.get('url') + state = check.find('state').text + if state != 'success': + info = " - %s check: %s" % (state, check.get('name')) + url = check.find('url') + if url is not None: + info += " " + url.text report.append(info) break @@ -89,11 +91,11 @@ class CheckCommand(object): :param project: project to check, None for all """ if project: - report = self._check_project(project) + report = self._check_project(project) else: - report = [] - for project in self.api.get_staging_projects(): - report.extend(self._check_project(project)) + report = [] + for project in self.api.get_staging_projects(): + report.extend(self._check_project(project)) print('\n'.join(report)) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 2e229e70..f9b5784b 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -880,8 +880,8 @@ class StagingAPI(object): if not staging: raise oscerr.WrongArgs('No staging given') - import traceback - traceback.print_stack() + #import traceback + #traceback.print_stack() opts = {} if requests: opts['requests'] = 1