Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fix CSIT broken issue when numa_node value is -1 on single Socket platform
[csit.git]
/
resources
/
libraries
/
python
/
SetupFramework.py
diff --git
a/resources/libraries/python/SetupFramework.py
b/resources/libraries/python/SetupFramework.py
index
61a0234
..
46b8597
100644
(file)
--- a/
resources/libraries/python/SetupFramework.py
+++ b/
resources/libraries/python/SetupFramework.py
@@
-56,7
+56,7
@@
def pack_framework_dir():
proc = Popen(
split("tar --sparse --exclude-vcs --exclude=output*.xml "
proc = Popen(
split("tar --sparse --exclude-vcs --exclude=output*.xml "
- "--exclude=./tmp -
-exclude=*.deb --exclude=*.rpm -
zcf {0} ."
+ "--exclude=./tmp -zcf {0} ."
.format(file_name)), stdout=PIPE, stderr=PIPE)
(stdout, stderr) = proc.communicate()
.format(file_name)), stdout=PIPE, stderr=PIPE)
(stdout, stderr) = proc.communicate()
@@
-84,6
+84,7
@@
def copy_tarball_to_node(tarball, node):
ssh.connect(node)
ssh.scp(tarball, "/tmp/")
ssh.connect(node)
ssh.scp(tarball, "/tmp/")
+ logger.console('Copying tarball to {0} done'.format(node['host']))
def extract_tarball_at_node(tarball, node):
def extract_tarball_at_node(tarball, node):
@@
-108,6
+109,8
@@
def extract_tarball_at_node(tarball, node):
if ret_code != 0:
raise RuntimeError('Failed to extract {0} at node {1}'
.format(tarball, node['host']))
if ret_code != 0:
raise RuntimeError('Failed to extract {0} at node {1}'
.format(tarball, node['host']))
+ logger.console('Extracting tarball to {0} on {1} done'
+ .format(con.REMOTE_FW_DIR, node['host']))
def create_env_directory_at_node(node):
def create_env_directory_at_node(node):
@@
-131,8
+134,8
@@
def create_env_directory_at_node(node):
if ret_code != 0:
raise RuntimeError('Virtualenv setup including requirements.txt on {0}'
.format(node['host']))
if ret_code != 0:
raise RuntimeError('Virtualenv setup including requirements.txt on {0}'
.format(node['host']))
- else:
-
logger.console('Virtualenv on {0} created'.format(node['host']))
+
+ logger.console('Virtualenv on {0} created'.format(node['host']))
def setup_node(args):
def setup_node(args):
@@
-224,8
+227,7
@@
class SetupFramework(object):
:param nodes: Topology nodes.
:type nodes: dict
:param nodes: Topology nodes.
:type nodes: dict
- :returns: True - success, False - error
- :rtype: bool
+ :raises RuntimeError: If setup framework failed.
"""
tarball = pack_framework_dir()
"""
tarball = pack_framework_dir()
@@
-256,10
+258,8
@@
class SetupFramework(object):
delete_local_tarball(tarball)
if node_success:
logger.console('All nodes are ready')
delete_local_tarball(tarball)
if node_success:
logger.console('All nodes are ready')
- return True
else:
else:
- logger.console('Failed to setup framework')
- return False
+ raise RuntimeError('Failed to setup framework')
class CleanupFramework(object):
class CleanupFramework(object):
@@
-271,8
+271,7
@@
class CleanupFramework(object):
:param nodes: Topology nodes.
:type nodes: dict
: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')
"""
# Turn off logging since we use multiprocessing
log_level = BuiltIn().set_log_level('NONE')
@@
-295,7
+294,5
@@
class CleanupFramework(object):
if node_success:
logger.console('All nodes cleaned up')
if node_success:
logger.console('All nodes cleaned up')
- return True
else:
else:
- logger.console('Failed to cleaned up framework')
- return False
+ raise RuntimeError('Failed to cleaned up framework')