Explorar o código

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

Enis Afgan %!s(int64=9) %!d(string=hai) anos
pai
achega
502dade416

+ 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)
 0.3.1 - April 18, 2017. (sha f36a462e886d8444cb2818f6573677ecf0565315)
 -------
 -------
 
 

+ 1 - 1
cloudbridge/__init__.py

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

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

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

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

@@ -645,10 +645,6 @@ class AWSInstanceService(BaseInstanceService):
                                      False, data=instances)
                                      False, data=instances)
 
 
 
 
-AWS_INSTANCE_DATA_DEFAULT_URL = "https://d168wakzal7fp0.cloudfront.net/" \
-                                "aws_instance_data.json"
-
-
 class AWSInstanceTypesService(BaseInstanceTypesService):
 class AWSInstanceTypesService(BaseInstanceTypesService):
 
 
     def __init__(self, provider):
     def __init__(self, provider):
@@ -660,8 +656,8 @@ class AWSInstanceTypesService(BaseInstanceTypesService):
         Fetch info about the available instances.
         Fetch info about the available instances.
 
 
         To update this information, update the file pointed to by the
         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
         https://github.com/powdahound/ec2instances.info (in particular, this
         file: https://raw.githubusercontent.com/powdahound/ec2instances.info/
         file: https://raw.githubusercontent.com/powdahound/ec2instances.info/
         master/www/instances.json).
         master/www/instances.json).
@@ -669,7 +665,8 @@ class AWSInstanceTypesService(BaseInstanceTypesService):
         TODO: Needs a caching function with timeout
         TODO: Needs a caching function with timeout
         """
         """
         r = requests.get(self.provider.config.get(
         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()
         return r.json()
 
 
     def list(self, limit=None, marker=None):
     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']
 aws_reqs = ['boto>=2.38.0,<=2.46.1']
 full_reqs = base_reqs + aws_reqs + openstack_reqs
 full_reqs = base_reqs + aws_reqs + openstack_reqs
 # httpretty is required with/for moto 1.0.0 or AWS tests fail
 # 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)
              'flake8-import-order>=0.12', 'httpretty==0.8.10'] + full_reqs)
 
 
 setup(name='cloudbridge',
 setup(name='cloudbridge',