예제 #1
0
파일: test_class.py 프로젝트: a42/mist.io
    def test_021_add_Rackspace_backend(self):
        """
        --->Add Rackspace Backends
        """
        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 backend"
            return

        for prov in providers:
            if "Rack" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #2
0
파일: test_class.py 프로젝트: a42/mist.io
    def test_020_add_EC2_backend(self):
        """
        -->Add EC2 Backends
        Adds all EC2 Backends, 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 backend"
            return

        for prov in providers:
            if "EC2" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #3
0
    def test_024_add_SoftLayer_backend(self):
        """
        --->Add SoftLayer Backend
        """
        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 backend"
            return

        for prov in providers:
            if "Soft" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Addind %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #4
0
    def test_021_add_Rackspace_backend(self):
        """
        --->Add Rackspace Backends
        """
        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 backend"
            return

        for prov in providers:
            if "Rack" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #5
0
    def test_020_add_EC2_backend(self):
        """
        -->Add EC2 Backends
        Adds all EC2 Backends, 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 backend"
            return

        for prov in providers:
            if "EC2 AP SOUTHEAST" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri,
                                               title,
                                               provider,
                                               apikey,
                                               apisecret,
                                               cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        print "\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #6
0
    def test_025_rename_backend(self):
        """
        --->Rename Backend

        Adds a EC2 SOUTHEAST backend and renames it.
        """
        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 backend"
            return

        for prov in providers:
            if "SOUTHEAST" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Adding %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend
                #TODO erase the break
                break

        backend_id = backend['id']
        new_name = "Renamed Backend"
        print "\n>>>Rename %s backend to %s" % (prov['title'], new_name)
        backends.rename_backend(self.uri, backend_id, new_name, cookie=self.cookie)

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']
예제 #7
0
파일: test_class.py 프로젝트: a42/mist.io
    def test_024_add_SoftLayer_backend(self):
        """
        --->Add SoftLayer Backend
        """
        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 backend"
            return

        for prov in providers:
            if "Soft" in prov['title']:
                title = prov['title']
                provider = prov['provider']
                print "\n>>>Addind %s backend" % title
                backend = backends.add_backend(self.uri, title, provider, apikey, apisecret, cookie=self.cookie)
                self.test_config['BACKENDS'][backend['id']] = backend

        print"\nList all backends:"
        for back in backends.list_backends(self.uri, cookie=self.cookie):
            print back['title']