diff options
Diffstat (limited to 'fuel/deploy/cloud')
-rw-r--r-- | fuel/deploy/cloud/deploy.py | 26 | ||||
-rw-r--r-- | fuel/deploy/cloud/deployment.py | 69 |
2 files changed, 4 insertions, 91 deletions
diff --git a/fuel/deploy/cloud/deploy.py b/fuel/deploy/cloud/deploy.py index 1534f0b..705dda5 100644 --- a/fuel/deploy/cloud/deploy.py +++ b/fuel/deploy/cloud/deploy.py @@ -35,11 +35,9 @@ ArgParser = common.ArgParser class Deploy(object): - def __init__(self, dea_file, blade_node_file, plugins_dir, - no_health_check): + def __init__(self, dea_file, blade_node_file, no_health_check): self.dea = DeploymentEnvironmentAdapter(dea_file) self.blade_node_file = blade_node_file - self.plugins_dir = plugins_dir self.no_health_check = no_health_check self.macs_per_blade = {} self.blades = self.dea.get_node_ids() @@ -74,19 +72,8 @@ class Deploy(object): self.node_roles_dict, self.no_health_check) dep.deploy() - def install_plugins(self): - log('Installing Fuel Plugins') - if self.plugins_dir and os.path.isdir(self.plugins_dir): - for f in glob.glob('%s/*.rpm' % self.plugins_dir): - log('Found plugin %s, installing ...' % f) - r, c = exec_cmd('fuel plugins --install %s' % f, False) - if c > 0 and 'does not update installed package' not in r: - err('Installation of Fuel Plugin %s failed' % f) - def deploy(self): - self.install_plugins() - self.get_blade_node_mapping() self.assign_roles_to_cluster_node_ids() @@ -105,20 +92,15 @@ def parse_arguments(): help='Deployment Environment Adapter: dea.yaml') parser.add_argument('blade_node_file', action='store', help='Blade Node mapping: blade_node.yaml') - parser.add_argument('plugins_dir', nargs='?', action='store', - help='Plugins directory') args = parser.parse_args() check_file_exists(args.dea_file) check_file_exists(args.blade_node_file) - return (args.dea_file, args.blade_node_file, args.plugins_dir, - args.no_health_check) + return (args.dea_file, args.blade_node_file, args.no_health_check) def main(): - - dea_file, blade_node_file, plugins_dir, no_health_check = parse_arguments() - - deploy = Deploy(dea_file, blade_node_file, plugins_dir, no_health_check) + dea_file, blade_node_file, no_health_check = parse_arguments() + deploy = Deploy(dea_file, blade_node_file, no_health_check) deploy.deploy() if __name__ == '__main__': diff --git a/fuel/deploy/cloud/deployment.py b/fuel/deploy/cloud/deployment.py index 43bd4b6..90f24fd 100644 --- a/fuel/deploy/cloud/deployment.py +++ b/fuel/deploy/cloud/deployment.py @@ -25,10 +25,6 @@ run_proc = common.run_proc parse = common.parse err = common.err log = common.log -literal_unicode = common.literal_unicode -literal_unicode_representer = common.literal_unicode_representer -yaml.add_representer(literal_unicode, literal_unicode_representer) -backup = common.backup class Deployment(object): @@ -41,70 +37,6 @@ class Deployment(object): self.node_id_roles_dict = node_id_roles_dict self.no_health_check = no_health_check - def download_deployment_info(self): - log('Download deployment info for environment %s' % self.env_id) - deployment_dir = ('%s/deployment_%s' - % (self.yaml_config_dir, self.env_id)) - if os.path.exists(deployment_dir): - shutil.rmtree(deployment_dir) - exec_cmd('fuel deployment --env %s --download --dir %s' - % (self.env_id, self.yaml_config_dir)) - - def upload_deployment_info(self): - log('Upload deployment info for environment %s' % self.env_id) - exec_cmd('fuel --env %s deployment --upload --dir %s' - % (self.env_id, self.yaml_config_dir)) - - def __update_opnfv_dict(self, opnfv_dict, key, node_type, val): - if val: - if key not in opnfv_dict: - opnfv_dict.update({key: {}}) - opnfv_dict[key].update({node_type: val}) - - def config_opnfv(self): - log('Configure OPNFV settings on environment %s' % self.env_id) - self.download_deployment_info() - - opnfv = {'opnfv': {}} - dns_list = self.dea.get_dns_list() - host_list = self.dea.get_hosts() - - ntp_list_for_controller = '' - for ntp in self.dea.get_ntp_list(): - ntp_list_for_controller += 'server %s\n' % ntp - - ntp_list_for_compute = '' - for controller_file in glob.glob( - '%s/deployment_%s/*controller*.yaml' - % (self.yaml_config_dir, self.env_id)): - with io.open(controller_file) as stream: - controller = yaml.load(stream) - ntp_list_for_compute += 'server %s\n' % controller['fqdn'] - - self.__update_opnfv_dict( - opnfv['opnfv'], 'dns', 'controller', dns_list[:]) - self.__update_opnfv_dict( - opnfv['opnfv'], 'dns', 'compute', dns_list[:]) - self.__update_opnfv_dict( - opnfv['opnfv'], 'ntp', 'controller', - literal_unicode(ntp_list_for_controller)) - self.__update_opnfv_dict( - opnfv['opnfv'], 'ntp', 'compute', - literal_unicode(ntp_list_for_compute)) - - if host_list: - opnfv['opnfv'].update({'hosts': host_list}) - - for node_file in glob.glob('%s/deployment_%s/*.yaml' - % (self.yaml_config_dir, self.env_id)): - with io.open(node_file) as stream: - node = yaml.load(stream) - node.update(opnfv) - with io.open(node_file, 'w') as stream: - yaml.dump(node, stream, default_flow_style=False) - - self.upload_deployment_info() - def run_deploy(self): WAIT_LOOP = 180 SLEEP_TIME = 60 @@ -159,7 +91,6 @@ class Deployment(object): err('Healthcheck failed!') def deploy(self): - self.config_opnfv() self.run_deploy() self.verify_node_status() if not self.no_health_check: |