Fix finding the correct configdocs version
Fixes an issue where only the first committed version was being identified. Change-Id: I751e5a306848f38b1c73e28ffc54dff3ab54100b
This commit is contained in:
parent
b3d154163d
commit
723c91b585
@ -55,22 +55,22 @@ class DeckhandGetDesignOperator(DeckhandBaseOperator):
|
|||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
raise AirflowException(e)
|
raise AirflowException(e)
|
||||||
|
|
||||||
# Print the number of revisions that is currently available
|
# Print info about revisions from DeckHand
|
||||||
# in DeckHand
|
logging.info("Revisions response: %s", revisions)
|
||||||
logging.info("The number of revisions is %s", revisions['count'])
|
logging.info("The number of committed revisions is %s",
|
||||||
|
revisions['count'])
|
||||||
|
|
||||||
# Search for the last committed version and save it as xcom
|
# Search for the latest committed version and save it as xcom.
|
||||||
|
# Since the order : desc paramater above, this is index 0 if there
|
||||||
|
# are any results
|
||||||
revision_list = revisions.get('results', [])
|
revision_list = revisions.get('results', [])
|
||||||
|
|
||||||
if revision_list:
|
if revision_list:
|
||||||
self.committed_ver = revision_list[-1].get('id')
|
self.committed_ver = revision_list[0].get('id')
|
||||||
else:
|
logging.info("Latest committed revision is %d", self.committed_ver)
|
||||||
raise AirflowException("No revision found in Deckhand!")
|
|
||||||
|
|
||||||
if self.committed_ver:
|
# Error if we cannot resolve the committed version to use.
|
||||||
logging.info("Last committed revision is %d", self.committed_ver)
|
if not self.committed_ver:
|
||||||
else:
|
raise AirflowException("No committed revision found in Deckhand!")
|
||||||
raise AirflowException("Failed to retrieve committed revision!")
|
|
||||||
|
|
||||||
|
|
||||||
class DeckhandGetDesignOperatorPlugin(AirflowPlugin):
|
class DeckhandGetDesignOperatorPlugin(AirflowPlugin):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user