From ba25afb8b30e8f757ea1a6a2819d30dd1644e5d3 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Mon, 6 Feb 2017 22:10:00 +0100 Subject: [deployment handler] Refactor the old installer_handler This is a util library to interact with the deployment regardless of the installer. Objects: - Deployment - Node - DeploymentHandler - ApexAdapter - FuelAdapter - Factory The installer adapters implement some of the abstract functions of DeploymentHandler class that can't be generalized. Printout of example.py: http://pastebin.com/raw/SF3A1fee More info: JIRA: RELENG-149 Change-Id: I5c9e94459d5be0bfad6ffac29908a8cfc7ba919c Signed-off-by: jose.lausuch --- modules/opnfv/deployment/example.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/opnfv/deployment/example.py (limited to 'modules/opnfv/deployment/example.py') diff --git a/modules/opnfv/deployment/example.py b/modules/opnfv/deployment/example.py new file mode 100644 index 000000000..6a76eb9c3 --- /dev/null +++ b/modules/opnfv/deployment/example.py @@ -0,0 +1,21 @@ +# This is an example of usage of this Tool +# Author: Jose Lausuch (jose.lausuch@ericsson.com) + +from opnfv.deployment import factory + +handler = factory.Factory.get_handler('apex', + '192.168.122.135', + 'stack', + pkey_file='/root/.ssh/id_rsa') + + +installer_node = handler.get_installer_node() +print("Hello, I am node '%s'" % installer_node.run_cmd('hostname')) +installer_node.get_file('/home/stack/overcloudrc', './overcloudrc') + +nodes = handler.get_nodes() +for node in nodes: + print("Hello, I am node '%s' and my ip is %s." % + (node.run_cmd('hostname'), node.ip)) + +print handler.get_deployment_info() -- cgit 1.2.3-korg