diff options
author | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2016-12-13 14:07:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-13 14:07:03 +0000 |
commit | 4a9cd22e5d4b44419721c4b7ef6c92c186963e4a (patch) | |
tree | 6e82b55c9a2b5b468b9b44e40faf68dd3c7d7760 /odl-pipeline | |
parent | 2dd53e9153a37a5a9f14a8772224dbdaa091bbfa (diff) | |
parent | eea4d05fb495d9f7848489e238c6be2327ab34f3 (diff) |
Merge "adding common/config"
Diffstat (limited to 'odl-pipeline')
-rw-r--r-- | odl-pipeline/lib/common/__init__.py | 0 | ||||
-rw-r--r-- | odl-pipeline/lib/common/config.py | 5 | ||||
-rwxr-xr-x | odl-pipeline/lib/deployment_cloner/deployment_cloner.py | 3 | ||||
-rwxr-xr-x | odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py | 18 | ||||
-rwxr-xr-x | odl-pipeline/lib/tripleo_manager/tripleo_manager.py | 22 |
5 files changed, 27 insertions, 21 deletions
diff --git a/odl-pipeline/lib/common/__init__.py b/odl-pipeline/lib/common/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/odl-pipeline/lib/common/__init__.py diff --git a/odl-pipeline/lib/common/config.py b/odl-pipeline/lib/common/config.py new file mode 100644 index 0000000..58ebff5 --- /dev/null +++ b/odl-pipeline/lib/common/config.py @@ -0,0 +1,5 @@ + +# inside the clone info folder +ID_RSA_PATH = '/undercloud_ssh/' +NODE_YAML_PATH = '/node.yaml' +OVERCLOUDRC_PATH = '/openstack.cred' diff --git a/odl-pipeline/lib/deployment_cloner/deployment_cloner.py b/odl-pipeline/lib/deployment_cloner/deployment_cloner.py index 4ba5ee9..dc2f3ba 100755 --- a/odl-pipeline/lib/deployment_cloner/deployment_cloner.py +++ b/odl-pipeline/lib/deployment_cloner/deployment_cloner.py @@ -4,6 +4,7 @@ from utils.utils_log import for_all_methods, log_enter_exit from utils.service import Service from utils.node_manager import NodeManager from utils.processutils import execute +from common import config as CONFIG @for_all_methods(log_enter_exit) @@ -36,7 +37,7 @@ class DeploymentCloner(Service): % self.undercloud_root_dir, log_true=True) underlcloud.copy('from', dest_dir, self.undercloud_root_dir + '/cloner-info/') - node_yaml_path = dest_dir + '/cloner-info/node.yaml' + node_yaml_path = dest_dir + '/cloner-info/' + CONFIG.NODE_YAML_PATH node_yaml = utils_yaml.read_dict_from_yaml(node_yaml_path) for name, node in node_yaml['servers'].iteritems(): node['vNode-name'] = self.get_virtual_node_name_from_mac( diff --git a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py index 190abcf..9eb2a70 100755 --- a/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py +++ b/odl-pipeline/lib/odl_reinstaller/odl_reinstaller.py @@ -4,15 +4,20 @@ from utils.utils_log import LOG, for_all_methods, log_enter_exit from utils.service import Service from utils.node_manager import NodeManager from utils.ssh_util import SSH_CONFIG +from common import config as CONFIG +from utils import utils_yaml @for_all_methods(log_enter_exit) class ODLReInstaller(Service): def run(self, sys_args, config): - SSH_CONFIG['ID_RSA_PATH'] = sys_args.id_rsa + cloner_info_path = sys_args.cloner_info + SSH_CONFIG['ID_RSA_PATH'] = cloner_info_path + CONFIG.ID_RSA_PATH + node_config = utils_yaml.read_dict_from_yaml( + cloner_info_path + CONFIG.NODE_YAML_PATH) # copy ODL to all nodes where it need to be copied - self.nodes = NodeManager(config['servers']).get_nodes() + self.nodes = NodeManager(node_config['servers']).get_nodes() for node in self.nodes: LOG.info('Disconnecting OpenVSwitch from controller on node %s' % node.name) @@ -64,17 +69,12 @@ class ODLReInstaller(Service): % ovs_controller, as_root=True) def create_cli_parser(self, parser): - parser.add_argument('-c', '--config', - help=("Give the path to the node config file " - "(node.yaml)"), + parser.add_argument('--cloner-info', + help=("Give the path to the clone info"), required=True) parser.add_argument('--odl-artifact', help=("Path to Opendaylight tarball"), required=True) - parser.add_argument('--id-rsa', - help=("Path to the identity file which can " - "be used to connect to the overcloud"), - required=True) return parser diff --git a/odl-pipeline/lib/tripleo_manager/tripleo_manager.py b/odl-pipeline/lib/tripleo_manager/tripleo_manager.py index 456564c..0a4ec0d 100755 --- a/odl-pipeline/lib/tripleo_manager/tripleo_manager.py +++ b/odl-pipeline/lib/tripleo_manager/tripleo_manager.py @@ -11,6 +11,7 @@ from utils.utils_log import log_enter_exit, for_all_methods, LOG from utils.service import Service from utils.shutil import shutil from utils.node_manager import NodeManager +from common import config as CONFIG @for_all_methods(log_enter_exit) @@ -31,11 +32,7 @@ class TripleOManager(Service): def run(self, sys_args, config): self.gen_node_info() self.prepare_for_ci_pipeline() - self.gen_env_info(sys_args, config) - self.gen_virtual_deployment_info(sys_args, config) - - def gen_virtual_deployment_info(self, sys_args, config): - pass + self.gen_env_info(sys_args) def prepare_for_ci_pipeline(self): node_manager = NodeManager(config=self.node_info['servers']) @@ -65,18 +62,21 @@ class TripleOManager(Service): # Disconnect ovs node.execute('ovs-vsctl del-controller br-int', as_root=True) - def gen_env_info(self, sys_args, config): + def gen_env_info(self, sys_args): shutil.mkdir_if_not_exsist(sys_args.out) - self.write_out_yaml_config(self.node_info, sys_args.out + '/node.yaml') + self.write_out_yaml_config(self.node_info, + sys_args.out + CONFIG.NODE_YAML_PATH) # copy ssh key shutil.copy('to', '/home/stack/.ssh/id_rsa', - sys_args.out + '/undercloud_ssh/') + sys_args.out + CONFIG.ID_RSA_PATH) shutil.copy('to', '/home/stack/.ssh/id_rsa.pub', - sys_args.out + '/undercloud_ssh/') + sys_args.out + CONFIG.ID_RSA_PATH) # copy rc files - shutil.copy('to', '/home/stack/stackrc', sys_args.out) - shutil.copy('to', '/home/stack/overcloudrc', sys_args.out) + shutil.copy('to', '/home/stack/stackrc', + sys_args.out) + shutil.copy('to', '/home/stack/overcloudrc', + sys_args.out + CONFIG.OVERCLOUDRC_PATH) def gen_node_info(self): for network in self.neutroncl.list_networks()['networks']: |