[FIX] Correct design ref use with Drydock client

Shipyard was passing a complete design reference dictionary to the
Drydock client, as it would for calling the Drydock API directly. This
causes an error to be reported (and subsequently ignored) during
validation of the DeploymentStrategy document. This change corrects the
behavior by passing only the href to the Drydock Client from the
deployment strategy validator

Change-Id: Idca0a69ec4ea11bf2bc4b520eb1512c0bdcd481b
This commit is contained in:
Bryan Strassner 2018-08-22 09:51:34 -05:00
parent 7d9ca0b69b
commit 106223f17b
2 changed files with 6 additions and 2 deletions

View File

@ -36,6 +36,10 @@ class DesignRefHelper:
"""
return json.dumps(self.get_design_reference_dict(revision_id))
def get_design_reference_href(self, revision_id):
"""Returns only the href to the deckhand design"""
return "deckhand+{}".format(self._path.format(revision_id))
def get_design_reference_dict(self, revision_id):
"""Constructs a Deckhand specific design reference
@ -44,6 +48,6 @@ class DesignRefHelper:
"""
return {
"rel": "design",
"href": "deckhand+{}".format(self._path.format(revision_id)),
"href": self.get_design_reference_href(revision_id),
"type": "application/x-yaml"
}

View File

@ -42,7 +42,7 @@ def _get_node_lookup(revision_id):
return NodeLookup(
service_clients.drydock_client(),
DesignRefHelper().get_design_reference_dict(revision_id)
DesignRefHelper().get_design_reference_href(revision_id)
).lookup