def deploy(self): self.client = fuelclient.FuelClient(self.config["api_url"]) self.nodes = self.client.get_nodes() controllers = self._get_nodes("controller") computes = self._get_nodes("compute") cinders = self._get_nodes("cinder") computes_cinders = self._get_nodes("cinder+compute") cluster = fuelclient.FuelCluster( self.client, name=self.config["deploy_name"], release=self._get_release_id(), mode=self.config["mode"], net_provider=self.config["net_provider"], net_segment_type=self.config.get("net_segment_type", "gre"), ) cluster.set_nodes(controllers, ["controller"]) cluster.set_nodes(computes, ["compute"]) cluster.set_nodes(cinders, ["cinder"]) cluster.set_nodes(computes_cinders, ["compute", "cinder"]) cluster.configure_network(self.config["networks"]) cluster.deploy() self.deployment.add_resource("FuelEngine", type="cloud", info={"id": cluster.cluster["id"]}) ip = cluster.get_endpoint_ip() attrs = cluster.get_attributes()["editable"]["access"] admin_endpoint = objects.Endpoint("http://%s:5000/v2.0/" % ip, attrs["user"]["value"], attrs["password"]["value"], attrs["tenant"]["value"], consts.EndpointPermission.ADMIN) return {"admin": admin_endpoint}
def deploy(self): self.client = fuelclient.FuelClient(self.config['api_url']) self.nodes = self.client.get_nodes() controllers = self._get_nodes('controller') computes = self._get_nodes('compute') cinders = self._get_nodes('cinder') computes_cinders = self._get_nodes('cinder+compute') cluster = fuelclient.FuelCluster( self.client, name=self.config['deploy_name'], release=self._get_release_id(), mode=self.config['mode'], net_provider=self.config['net_provider'], net_segment_type=self.config.get('net_segment_type', 'gre'), ) cluster.set_nodes(controllers, ['controller']) cluster.set_nodes(computes, ['compute']) cluster.set_nodes(cinders, ['cinder']) cluster.set_nodes(computes_cinders, ['compute', 'cinder']) cluster.configure_network(self.config['networks']) cluster.deploy() self.deployment.add_resource('FuelEngine', type='cloud', info={'id': cluster.cluster['id']}) ip = cluster.get_endpoint_ip() attrs = cluster.get_attributes()['editable']['access'] admin_endpoint = objects.Endpoint('http://%s:5000/v2.0/' % ip, attrs['user']['value'], attrs['password']['value'], attrs['tenant']['value'], consts.EndpointPermission.ADMIN) return {"admin": admin_endpoint}
def setUp(self): super(FuelClusterTestCase, self).setUp() self.client = mock.Mock() self.config = {"name": "Cluster"} self.cluster = fuelclient.FuelCluster(self.client, **self.config)