예제 #1
0
 def new_cloudstack_conn(self):
     access_data = self.get_access_data()
     if access_data and 'api_url' in access_data:
         return cloudstack.Client(
                         access_data['api_url'],
                         apiKey=access_data.get('api_key'),
                         secretKey=access_data.get('secret_key'))
예제 #2
0
def _create_connection():
    pl = node.__node__['platform']
    try:
        conn = cloudstack.Client(pl.get_access_data('api_url'),
                                 apiKey=pl.get_access_data('api_key'),
                                 secretKey=pl.get_access_data('secret_key'))
    except PlatformError:
        raise NoCredentialsError(sys.exc_info()[1])
    return conn
예제 #3
0
 def new_cloudstack_conn(self):
     if self._access_data and 'api_url' in self._access_data:
         return cloudstack.Client(
                         self._access_data['api_url'],
                         apiKey=self._access_data.get('api_key'),
                         secretKey=self._access_data.get('secret_key'))