def test_021_add_Rackspace_cloud(self): """ --->Add Rackspace Clouds """ providers = self.test_config['SUPPORTED_PROVIDERS'] creds = self.credentials['Rackspace'] apikey = creds['username'] apisecret = creds['api_key'] if not apikey or not apisecret: print "\n>>>Could not find credentials for Rackspace, will not add cloud" return for prov in providers: if "Rack" in prov['title']: title = prov['title'] provider = prov['provider'] print "\n>>>Adding %s cloud" % title cloud = clouds.add_cloud(self.uri, title, provider, apikey, apisecret, cookie=self.cookie) self.test_config['CLOUDS'][cloud['id']] = cloud #TODO erase the break break print"\nList all clouds:" for back in clouds.list_clouds(self.uri, cookie=self.cookie): print back['title']
def test_020_add_EC2_cloud(self): """ -->Add EC2 Clouds Adds all EC2 Clouds, if no EC2 creds are given in the yaml file it will print a Message and return True """ providers = self.test_config['SUPPORTED_PROVIDERS'] creds = self.credentials['EC2'] apikey = creds['api_key'] apisecret = creds['api_secret'] if not apikey or not apisecret: print "\n>>>Could not find credentials for EC2, will not add cloud" return for prov in providers: if "EC2 AP SOUTHEAST" in prov['title']: title = prov['title'] provider = prov['provider'] print "\n>>>Adding %s cloud" % title cloud = clouds.add_cloud(self.uri, title, provider, apikey, apisecret, cookie=self.cookie) self.test_config['CLOUDS'][cloud['id']] = cloud #TODO erase the break break print"\nList all clouds:" for back in clouds.list_clouds(self.uri, cookie=self.cookie): print back['title']
def test_024_add_SoftLayer_cloud(self): """ --->Add SoftLayer Cloud """ providers = self.test_config['SUPPORTED_PROVIDERS'] creds = self.credentials['SoftLayer'] apikey = creds['username'] apisecret = creds['api_key'] if not apikey or not apisecret: print "\n>>>Could not find credentials for SoftLayer, will not add cloud" return for prov in providers: if "Soft" in prov['title']: title = prov['title'] provider = prov['provider'] print "\n>>>Addind %s cloud" % title cloud = clouds.add_cloud(self.uri, title, provider, apikey, apisecret, cookie=self.cookie) self.test_config['CLOUDS'][cloud['id']] = cloud print"\nList all clouds:" for back in clouds.list_clouds(self.uri, cookie=self.cookie): print back['title']