Przeglądaj źródła

Improved travis caching, fixed azure build issues

Nuwan Goonasekera 8 lat temu
rodzic
commit
87168962ce

+ 4 - 1
.travis.yml

@@ -1,6 +1,9 @@
 dist: trusty
 dist: trusty
 language: python
 language: python
-cache: pip
+cache:
+  directories:
+    - $HOME/.cache/pip
+    - $TRAVIS_BUILD_DIR/.tox
 os:
 os:
   - linux
   - linux
 #  - osx
 #  - osx

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

@@ -622,7 +622,8 @@ class AzureInstanceService(BaseInstanceService):
         def attach_volume(volume, delete_on_terminate):
         def attach_volume(volume, delete_on_terminate):
             disks.append({
             disks.append({
                 'lun': volumes_count,
                 'lun': volumes_count,
-                'name': volume.name,
+                # pylint:disable=protected-access
+                'name': volume._volume.name,
                 'create_option': 'attach',
                 'create_option': 'attach',
                 'managed_disk': {
                 'managed_disk': {
                     'id': volume.resource_id
                     'id': volume.resource_id

+ 1 - 1
test/test_compute_service.py

@@ -183,7 +183,7 @@ class CloudComputeServiceTestCase(ProviderTestBase):
         lc.add_volume_device(
         lc.add_volume_device(
             is_root=True,
             is_root=True,
             source=img,
             source=img,
-            size=img.min_disk if img and img.min_disk > 30 else 30,
+            size=img.min_disk if img and img.min_disk else 30,
             delete_on_terminate=True)
             delete_on_terminate=True)
 
 
         # Attempting to add more than one root volume should raise an
         # Attempting to add more than one root volume should raise an