Trollgeir commented on a change in pull request #5319:
[AIRFLOW-4564][AIRFLOW-4523][AIRFLOW-4577] Azure Container Instance bugfixes
and improvements
URL: https://github.com/apache/airflow/pull/5319#discussion_r299005331
##########
File path: airflow/contrib/hooks/azure_container_instance_hook.py
##########
@@ -92,43 +92,28 @@ def create_or_update(self, resource_group, name,
container_group):
name,
container_group)
+ from zope.deprecation import deprecation
+
+ @deprecation.deprecate("get_state_exitcode_details() is deprecated.
Related method is get_state()")
def get_state_exitcode_details(self, resource_group, name):
- """
- Get the state and exitcode of a container group
+ cg_state = self.get_state(resource_group, name)
+ c_state = cg_state.containers[0].instance_view.current_state
+ return (c_state.state, c_state.exit_code, c_state.detail_status)
- :param resource_group: the name of the resource group
- :type resource_group: str
- :param name: the name of the container group
- :type name: str
- :return: A tuple with the state, exitcode, and details.
- If the exitcode is unknown 0 is returned.
- :rtype: tuple(state,exitcode,details)
- """
- current_state = self._get_instance_view(resource_group,
name).current_state
- return (current_state.state,
- current_state.exit_code,
- current_state.detail_status)
-
- def _get_instance_view(self, resource_group, name):
- response = self.connection.container_groups.get(resource_group,
- name,
- raw=False)
- return response.containers[0].instance_view
-
- def get_messages(self, resource_group, name):
Review comment:
Will do
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services