def __init__(self, *args, **kwargs): if kwargs.get('gce_driver'): self.gce = kwargs['gce_driver'] else: self.gce = GCENodeDriver(*args, **kwargs) self.connection = self.gce.connection
def setUp(self): GCEMockHttp.test = self GCENodeDriver.connectionCls.conn_classes = (GCEMockHttp, GCEMockHttp) GoogleBaseAuthConnection.conn_classes = (GoogleAuthMockHttp, GoogleAuthMockHttp) GCEMockHttp.type = None kwargs = GCE_KEYWORD_PARAMS.copy() kwargs['auth_type'] = 'IA' kwargs['datacenter'] = self.datacenter self.driver = GCENodeDriver(*GCE_PARAMS, **kwargs)
def __init__(self, config, gcp_credentials_file): self.config = config creds = read_json(gcp_credentials_file) self._compute = GCENodeDriver( creds['client_email'], gcp_credentials_file, project=creds['project_id'], datacenter=self.config['gcp_compute_zone'], timeout=self.config['compute_timeout']) self._dns = GoogleDNSDriver(creds['client_email'], gcp_credentials_file, project=creds['project_id']) self._dns_zone = self._dns.get_zone(config['gcp_dns_zone']) self.log = logging.getLogger(__name__ + '.' + self._name)