To use method in cases when ec is expected to be not zero and reduce
duplicated code in asserts messages new parameters in 'run_on_remote'
method proposed with following logic:
* 'assert_ec_equal' with default '[0]'. Error message will be logged only
when exit_code != assert_ec_equal. Can pass xrange(1,8) or [1, 4, 5]
* 'raise_on_assert' with default 'True'. Exception now can be
surpressed when exit_code != assert_ec_equal if 'raiseOnAssert' is 'False'
Also:
* 'run_on_remote_get_results' return dict with:
'command',
'host',
'stdout',
'stdout_str',
'stdout_len',
'stdout_json', if jsonify=true
'stderr',
'stderr_str',
'stderr_len',
'exit_code', instead of just stdout string
* 'run_on_remote' wrapper leaved for compatibility
Reviewed: https:/ /review. openstack. org/217396 /git.openstack. org/cgit/ stackforge/ fuel-qa/ commit/ ?id=32b6bc8cea5 c595aa92e2c2c82 5762b53c49e191
Committed: https:/
Submitter: Jenkins
Branch: master
commit 32b6bc8cea5c595 aa92e2c2c825762 b53c49e191
Author: Maksym Strukov <email address hidden>
Date: Wed Aug 26 23:59:36 2015 +0300
Improve 'run_on_remote' for more general use
To use method in cases when ec is expected to be not zero and reduce
duplicated code in asserts messages new parameters in 'run_on_remote'
method proposed with following logic:
* 'assert_ec_equal' with default '[0]'. Error message will be logged only
when exit_code != assert_ec_equal. Can pass xrange(1,8) or [1, 4, 5]
* 'raise_on_assert' with default 'True'. Exception now can be
surpressed when exit_code != assert_ec_equal if 'raiseOnAssert' is 'False'
Also: remote_ get_results' return dict with: stdout_ json', if jsonify=true
* 'run_on_
'command',
'host',
'stdout',
'stdout_str',
'stdout_len',
'
'stderr',
'stderr_str',
'stderr_len',
'exit_code', instead of just stdout string
* 'run_on_remote' wrapper leaved for compatibility
Change-Id: I32a9d743929d01 857a88844976074 df719d9880a
Closes-Bug: #1489165