瀏覽代碼

Merge branch 'master' of github.com:gvlproject/cloudbridge

Enis Afgan 9 年之前
父節點
當前提交
502dade416
共有 5 個文件被更改,包括 18 次插入13 次删除
  1. 6 0
      CHANGELOG.rst
  2. 1 1
      cloudbridge/__init__.py
  3. 6 4
      cloudbridge/cloud/providers/aws/provider.py
  4. 4 7
      cloudbridge/cloud/providers/aws/services.py
  5. 1 1
      setup.py

+ 6 - 0
CHANGELOG.rst

@@ -1,3 +1,9 @@
+0.3.2 - June 10, 2017. (sha f07f3cbd758a0872b847b5537d9073c90f87c24d)
+-------
+
+* Patch release to support files>5GB with OpenStack (thanks @MartinPaulo)
+* Misc bug fixes
+
 0.3.1 - April 18, 2017. (sha f36a462e886d8444cb2818f6573677ecf0565315)
 -------
 

+ 1 - 1
cloudbridge/__init__.py

@@ -2,7 +2,7 @@
 import logging
 
 # Current version of the library
-__version__ = '0.3.1'
+__version__ = '0.3.2'
 
 
 def get_version():

+ 6 - 4
cloudbridge/cloud/providers/aws/provider.py

@@ -7,8 +7,8 @@ from boto.ec2.regioninfo import RegionInfo
 try:
     # These are installed only for the case of a dev instance
     from httpretty import HTTPretty
-    from moto import mock_ec2_deprecated as mock_ec2
-    from moto import mock_s3_deprecated as mock_s3
+    from moto import mock_ec2
+    from moto import mock_s3
 except ImportError:
     # TODO: Once library logging is configured, change this
     print("[aws provider] moto library not available!")
@@ -26,6 +26,8 @@ from .services import AWSSecurityService
 class AWSCloudProvider(BaseCloudProvider):
 
     PROVIDER_ID = 'aws'
+    AWS_INSTANCE_DATA_DEFAULT_URL = "https://d168wakzal7fp0.cloudfront.net/" \
+                                    "aws_instance_data.json"
 
     def __init__(self, config):
         super(AWSCloudProvider, self).__init__(config)
@@ -171,8 +173,8 @@ class MockAWSCloudProvider(AWSCloudProvider, TestMockHelperMixin):
         self.s3mock = mock_s3()
         self.s3mock.start()
         HTTPretty.register_uri(
-            method="GET",
-            uri="https://d168wakzal7fp0.cloudfront.net/aws_instance_data.json",
+            HTTPretty.GET,
+            self.AWS_INSTANCE_DATA_DEFAULT_URL,
             body=u"""
 [
   {

+ 4 - 7
cloudbridge/cloud/providers/aws/services.py

@@ -645,10 +645,6 @@ class AWSInstanceService(BaseInstanceService):
                                      False, data=instances)
 
 
-AWS_INSTANCE_DATA_DEFAULT_URL = "https://d168wakzal7fp0.cloudfront.net/" \
-                                "aws_instance_data.json"
-
-
 class AWSInstanceTypesService(BaseInstanceTypesService):
 
     def __init__(self, provider):
@@ -660,8 +656,8 @@ class AWSInstanceTypesService(BaseInstanceTypesService):
         Fetch info about the available instances.
 
         To update this information, update the file pointed to by the
-        ``AWS_INSTANCE_DATA_DEFAULT_URL`` above. The content for this file
-        should be obtained from this repo
+        ``provider.AWS_INSTANCE_DATA_DEFAULT_URL`` above. The content for this
+        file should be obtained from this repo:
         https://github.com/powdahound/ec2instances.info (in particular, this
         file: https://raw.githubusercontent.com/powdahound/ec2instances.info/
         master/www/instances.json).
@@ -669,7 +665,8 @@ class AWSInstanceTypesService(BaseInstanceTypesService):
         TODO: Needs a caching function with timeout
         """
         r = requests.get(self.provider.config.get(
-            "aws_instance_info_url", AWS_INSTANCE_DATA_DEFAULT_URL))
+            "aws_instance_info_url",
+            self.provider.AWS_INSTANCE_DATA_DEFAULT_URL))
         return r.json()
 
     def list(self, limit=None, marker=None):

+ 1 - 1
setup.py

@@ -27,7 +27,7 @@ openstack_reqs = ['requests<2.13.0',
 aws_reqs = ['boto>=2.38.0,<=2.46.1']
 full_reqs = base_reqs + aws_reqs + openstack_reqs
 # httpretty is required with/for moto 1.0.0 or AWS tests fail
-dev_reqs = (['tox>=2.1.1', 'moto>=1.0.0', 'sphinx>=1.3.1', 'flake8>=3.3.0',
+dev_reqs = (['tox>=2.1.1', 'moto<1.0.0', 'sphinx>=1.3.1', 'flake8>=3.3.0',
              'flake8-import-order>=0.12', 'httpretty==0.8.10'] + full_reqs)
 
 setup(name='cloudbridge',