aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorStefan Kobza <skobza@cisco.com>2016-02-22 21:49:27 +0100
committerGerrit Code Review <gerrit@fd.io>2016-02-23 14:35:30 +0000
commita06a031c5865f34c2a651ef170778149fb8f0396 (patch)
tree50d2a1cf17be3ad1a4968cbd028f0c6a8b0f9092 /resources/libraries/python
parentd86efcabfab8b561e43a6e04b28dcf5664c059a2 (diff)
Automate VIRL simulation life cycle.
Change-Id: I126c42b994c1356acc202f4ec1b153c790c43d46 Signed-off-by: Stefan Kobza <skobza@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/SetupFramework.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/resources/libraries/python/SetupFramework.py b/resources/libraries/python/SetupFramework.py
index 47c609fada..cb0d536987 100644
--- a/resources/libraries/python/SetupFramework.py
+++ b/resources/libraries/python/SetupFramework.py
@@ -84,11 +84,25 @@ def create_env_directory_at_node(node):
logger.error('Virtualenv creation error: {0}'.format(stdout + stderr))
raise Exception('Virtualenv setup failed')
+def install_dependencies(node):
+ """TEMPORARY FUNCTION TO INSTALL DEPENDENCIES ON NODES BEFORE THE VIRL
+ HOSTS HAVE ALL PREREQUISITES INSTALLED"""
+ logger.console('Installing prerequisites on {0}'.format(node['host']))
+ ssh = SSH()
+ ssh.connect(node)
+ (ret_code, stdout, stderr) = ssh.exec_command(
+ 'sudo apt-get -y update; ' \
+ 'sudo apt-get -y install python-virtualenv python-dev', timeout=120)
+ if 0 != ret_code:
+ logger.error('Failed to install prerequisites: {0}'.
+ format(stdout + stderr))
+ raise Exception('Virtualenv setup failed')
def setup_node(args):
tarball, remote_tarball, node = args
copy_tarball_to_node(tarball, node)
extract_tarball_at_node(remote_tarball, node)
+ install_dependencies(node)
if node['type'] == NodeType.TG:
create_env_directory_at_node(node)