Просмотр исходного кода

- Implemented the initial get method implementation for bucket
- update travis yaml with proper commenting.

madhugilla 9 лет назад
Родитель
Сommit
4854bd149d
2 измененных файлов с 36 добавлено и 2 удалено
  1. 10 2
      cloudbridge/cloud/providers/azure/services.py
  2. 26 0
      codecov.yml

+ 10 - 2
cloudbridge/cloud/providers/azure/services.py

@@ -1,8 +1,12 @@
+import logging
+
 from cloudbridge.cloud.base.resources import ClientPagedResultList
 from cloudbridge.cloud.base.services import BaseObjectStoreService, BaseSecurityGroupService, BaseSecurityService
 
 from .resources import AzureBucket, AzureSecurityGroup
 
+log = logging.getLogger(__name__)
+
 
 class AzureSecurityService(BaseSecurityService):
     def __init__(self, provider):
@@ -71,8 +75,12 @@ class AzureObjectStoreService(BaseObjectStoreService):
         super(AzureObjectStoreService, self).__init__(provider)
 
     def get(self, bucket_id):
-        raise NotImplementedError(
-            "AzureObjectStoreService does not implement this service")
+        log.info("Azure Object Store Service get API with bucket id - " + str(bucket_id))
+        object_store = self.provider.azure_client.get_container(self.provider.group_name, self.provider.account_name,
+                                                                bucket_id.split('/')[8])
+        if object_store:
+            return AzureBucket(self.provider, object_store)
+        return None
 
     def find(self, name, limit=None, marker=None):
         object_store = self.provider.azure_client.get_container(name)

+ 26 - 0
codecov.yml

@@ -0,0 +1,26 @@
+codecov:
+  notify:
+    require_ci_to_pass: yes
+
+coverage:
+  precision: 2
+  round: down
+  range: "70...100"
+
+  status:
+    project: yes
+    patch: yes
+    changes: no
+
+parsers:
+  gcov:
+    branch_detection:
+      conditional: yes
+      loop: yes
+      method: no
+      macro: no
+
+comment:
+  layout: "header, diff"
+  behavior: default
+  require_changes: no