From cb68bdb490e19de32afc7fa1dc63ffa0df60b224 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Thu, 20 Jun 2019 07:58:48 +0200 Subject: [PATCH] Add missing docstring, use new raise_on_failure param The Zaza run_action functions ought to have a raise exception option, openstack-charmers/zaza#251 --- .../charm_tests/octavia/diskimage_retrofit/setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zaza/openstack/charm_tests/octavia/diskimage_retrofit/setup.py b/zaza/openstack/charm_tests/octavia/diskimage_retrofit/setup.py index 815cdfe..7fbca5e 100644 --- a/zaza/openstack/charm_tests/octavia/diskimage_retrofit/setup.py +++ b/zaza/openstack/charm_tests/octavia/diskimage_retrofit/setup.py @@ -23,6 +23,10 @@ def retrofit_amphora_image(unit='octavia-diskimage-retrofit/0', force=False, image_id=None): """Run action to retrofit Ubuntu Cloud image into Octavia ``amphora``. + :param unit: Name of unit to operate on + :type: unit: str + :param force: Force re-creation of image if it exists + :type force: bool :param image_id: Glance image ID used as source for retrofitting. (Default is to find it based on image properties.) :type image_id: str @@ -41,7 +45,6 @@ def retrofit_amphora_image(unit='octavia-diskimage-retrofit/0', action = zaza.model.run_action( unit, 'retrofit-image', - action_params=params) - if not action or action.status != 'completed': - raise Exception('run-action failed: "{}"'.format(action)) + action_params=params, + raise_on_failure=True) return action