Skip to content

Commit

Permalink
Merge dad1f84 into 34ae3bd
Browse files Browse the repository at this point in the history
  • Loading branch information
chiniforooshan committed Jun 27, 2017
2 parents 34ae3bd + dad1f84 commit 89c2f54
Show file tree
Hide file tree
Showing 4 changed files with 795 additions and 282 deletions.
2 changes: 1 addition & 1 deletion cloudbridge/cloud/providers/gce/helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# based on http://stackoverflow.com/a/39126754
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization as crypt_serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend


def generate_key_pair():
Expand Down
24 changes: 10 additions & 14 deletions cloudbridge/cloud/providers/gce/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
Provider implementation based on google-api-python-client library
for GCE.
"""


from cloudbridge.cloud.base import BaseCloudProvider
import httplib2
import json
import os
import re
from string import Template
import time
from string import Template

from cloudbridge.cloud.base import BaseCloudProvider

from googleapiclient import discovery
import googleapiclient.http
from googleapiclient import discovery

import httplib2

from oauth2client.client import GoogleCredentials
from oauth2client.service_account import ServiceAccountCredentials

from .services import GCEBlockStoreService
from .services import GCEComputeService
from .services import GCENetworkService
from .services import GCESecurityService
from .services import GCSObjectStoreService


class GCPResourceUrl(object):
Expand Down Expand Up @@ -164,6 +166,7 @@ def __init__(self, config):
self._security = GCESecurityService(self)
self._network = GCENetworkService(self)
self._block_store = GCEBlockStoreService(self)
self._object_store = GCSObjectStoreService(self)

self._compute_resources = GCPResources(self.gce_compute)
self._storage_resources = GCPResources(self.gcp_storage)
Expand All @@ -186,8 +189,7 @@ def block_store(self):

@property
def object_store(self):
raise NotImplementedError(
"GCECloudProvider does not implement this service")
return self._object_store

@property
def gce_compute(self):
Expand Down Expand Up @@ -228,12 +230,6 @@ def _postproc(*kwargs):
response = request.execute()
return response

def wait_for_global_operation(self, operation):
while True:
result = self.gce_compute.globalOperations().get(
project=self.project_name,
operation=operation['name']).execute()

def _connect_gcp_storage(self):
return discovery.build('storage', 'v1', credentials=self._credentials)

Expand Down
Loading

0 comments on commit 89c2f54

Please sign in to comment.