diff options
author | Peter Mikus <pmikus@cisco.com> | 2018-06-28 07:29:06 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2018-06-29 06:33:59 +0000 |
commit | b8bf181cafb0f4e8a317c308cfe83a3e022ce7c5 (patch) | |
tree | 2701ecd0469b586fc91ca5b1decddd69ebfa9cce /resources/libraries/python | |
parent | bcc95cec011f16feccfd00b92cbb4739ef58fbdd (diff) |
SetupFramework to detect failures, part II
- This patch is enforcing evaluation and aligning all __init__.robot
files to use the same logic.
Change-Id: I9e2bf5e904bb6d22f4e6a153c951c3b3c233e2fb
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/SetupFramework.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/resources/libraries/python/SetupFramework.py b/resources/libraries/python/SetupFramework.py index 61a0234692..ccf4e4fada 100644 --- a/resources/libraries/python/SetupFramework.py +++ b/resources/libraries/python/SetupFramework.py @@ -224,8 +224,7 @@ class SetupFramework(object): :param nodes: Topology nodes. :type nodes: dict - :returns: True - success, False - error - :rtype: bool + :raises RuntimeError: If setup framework failed. """ tarball = pack_framework_dir() @@ -256,10 +255,8 @@ class SetupFramework(object): delete_local_tarball(tarball) if node_success: logger.console('All nodes are ready') - return True else: - logger.console('Failed to setup framework') - return False + raise RuntimeError('Failed to setup framework') class CleanupFramework(object): @@ -271,8 +268,7 @@ class CleanupFramework(object): :param nodes: Topology nodes. :type nodes: dict - :returns: True - success, False - error - :rtype: bool + :raises RuntimeError: If cleanup framework failed. """ # Turn off logging since we use multiprocessing log_level = BuiltIn().set_log_level('NONE') @@ -295,7 +291,5 @@ class CleanupFramework(object): if node_success: logger.console('All nodes cleaned up') - return True else: - logger.console('Failed to cleaned up framework') - return False + raise RuntimeError('Failed to cleaned up framework') |