From 7046ad34ed7c30871be9918c6cace7a4839bceb4 Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Mon, 5 Mar 2018 05:08:19 +0000 Subject: [PATCH] Bug Fix - DeckhandRetrieveRenderedDoc Operator Testing performed after [0] was merged revealed 2 issues: 1) The name of the operator should be 'DeckhandRetrieveRenderedDocOperator' instead of 'DeckhandValidateSiteDesignOperator'. 2) We should be using task_id instead of subdag name to identify the task which requires retrieval of revision id This patch set is meant to correct the behavior [0] https://review.gerrithub.io/#/c/402347/ Change-Id: I4498cd37a1aa8f2b16e17b2a3e6d3e41b2ee47b1 --- shipyard_airflow/dags/deckhand_get_design.py | 4 ++-- shipyard_airflow/plugins/deckhand_base_operator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shipyard_airflow/dags/deckhand_get_design.py b/shipyard_airflow/dags/deckhand_get_design.py index 0055160e..e8d71a8e 100644 --- a/shipyard_airflow/dags/deckhand_get_design.py +++ b/shipyard_airflow/dags/deckhand_get_design.py @@ -14,7 +14,7 @@ from airflow.models import DAG from airflow.operators import DeckhandGetDesignOperator -from airflow.operators import DeckhandValidateSiteDesignOperator +from airflow.operators import DeckhandRetrieveRenderedDocOperator # Location of shiyard.conf @@ -38,7 +38,7 @@ def get_design_deckhand(parent_dag_name, child_dag_name, args): sub_dag_name=child_dag_name, dag=dag) - shipyard_retrieve_rendered_doc = DeckhandValidateSiteDesignOperator( + shipyard_retrieve_rendered_doc = DeckhandRetrieveRenderedDocOperator( task_id='shipyard_retrieve_rendered_doc', shipyard_conf=config_path, main_dag_name=parent_dag_name, diff --git a/shipyard_airflow/plugins/deckhand_base_operator.py b/shipyard_airflow/plugins/deckhand_base_operator.py index 263f29dd..60d4cca3 100644 --- a/shipyard_airflow/plugins/deckhand_base_operator.py +++ b/shipyard_airflow/plugins/deckhand_base_operator.py @@ -155,7 +155,7 @@ class DeckhandBaseOperator(BaseOperator): # 'deckhand_get_design_version' task. We need to extract # the xcom value from it in order to get the value of the # last committed revision ID - if self.sub_dag_name != 'deckhand_get_design_version': + if self.task_id != 'deckhand_get_design_version': # Retrieve 'revision_id' from xcom self.revision_id = task_instance.xcom_pull(