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
16 INSTALLERS = ["fuel", "apex", "compass", "joid"]
19 class InstallerHandler:
26 self.installer = installer.lower()
27 self.installer_ip = installer_ip
28 self.installer_user = installer_user
29 self.installer_pwd = installer_pwd
31 if self.installer == INSTALLERS[0]:
32 self.InstallerAdapter = FuelAdapter(self.installer_ip,
35 elif self.installer == INSTALLERS[1]:
36 self.InstallerAdapter = ApexAdapter(self.installer_ip)
37 elif self.installer == INSTALLERS[2]:
38 self.InstallerAdapter = CompassAdapter(self.installer_ip)
39 elif self.installer == INSTALLERS[3]:
40 self.InstallerAdapter = JoidAdapter(self.installer_ip)
42 print("Installer %s is not valid. "
43 "Please use one of the followings: %s"
44 % (self.installer, INSTALLERS))
47 def get_deployment_info(self):
48 return self.InstallerAdapter.get_deployment_info()
50 def get_nodes(self, options=None):
51 return self.InstallerAdapter.get_nodes(options=options)
53 def get_controller_ips(self, options=None):
54 return self.InstallerAdapter.get_controller_ips(options=options)
56 def get_compute_ips(self, options=None):
57 return self.InstallerAdapter.get_compute_ips(options=options)
59 def get_file_from_installer(self,
63 return self.InstallerAdapter.get_file_from_installer(remote_path,
67 def get_file_from_controller(self,
72 return self.InstallerAdapter.get_file_from_controller(remote_path,