1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # Author: Jose Lausuch (jose.lausuch@ericsson.com)
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 from opnfv.installer_adapters.fuel.FuelAdapter import FuelAdapter
11 from opnfv.installer_adapters.apex.ApexAdapter import ApexAdapter
12 from opnfv.installer_adapters.compass.CompassAdapter import CompassAdapter
13 from opnfv.installer_adapters.joid.JoidAdapter import JoidAdapter
14 from opnfv.installer_adapters.daisy.DaisyAdapter import DaisyAdapter
17 INSTALLERS = ["fuel", "apex", "compass", "joid", "daisy"]
20 class InstallerHandler:
27 self.installer = installer.lower()
28 self.installer_ip = installer_ip
29 self.installer_user = installer_user
30 self.installer_pwd = installer_pwd
32 if self.installer == INSTALLERS[0]:
33 self.InstallerAdapter = FuelAdapter(self.installer_ip,
36 elif self.installer == INSTALLERS[1]:
37 self.InstallerAdapter = ApexAdapter(self.installer_ip)
38 elif self.installer == INSTALLERS[2]:
39 self.InstallerAdapter = CompassAdapter(self.installer_ip)
40 elif self.installer == INSTALLERS[3]:
41 self.InstallerAdapter = JoidAdapter(self.installer_ip)
42 elif self.installer == INSTALLERS[4]:
43 self.InstallerAdapter = DaisyAdapter(self.installer_ip)
45 print("Installer %s is not valid. "
46 "Please use one of the followings: %s"
47 % (self.installer, INSTALLERS))
50 def get_deployment_info(self):
51 return self.InstallerAdapter.get_deployment_info()
53 def get_nodes(self, options=None):
54 return self.InstallerAdapter.get_nodes(options=options)
56 def get_controller_ips(self, options=None):
57 return self.InstallerAdapter.get_controller_ips(options=options)
59 def get_compute_ips(self, options=None):
60 return self.InstallerAdapter.get_compute_ips(options=options)
62 def get_file_from_installer(self,
66 return self.InstallerAdapter.get_file_from_installer(remote_path,
70 def get_file_from_controller(self,
75 return self.InstallerAdapter.get_file_from_controller(remote_path,