Преглед изворни кода

Don't fail if moto is not installed

Enis Afgan пре 7 година
родитељ
комит
3b5dbe975c
1 измењених фајлова са 8 додато и 5 уклоњено
  1. 8 5
      cloudbridge/cloud/providers/aws/provider.py

+ 8 - 5
cloudbridge/cloud/providers/aws/provider.py

@@ -3,11 +3,14 @@ import logging as log
 
 import boto3
 
-# These are installed only for the case of a dev instance
-from moto import mock_ec2
-from moto import mock_s3
-
-import responses
+try:
+    # These are installed only for the case of a dev instance
+    from moto import mock_ec2
+    from moto import mock_s3
+
+    import responses
+except ImportError:
+    log.debug("Development library moto is not installed.")
 
 from cloudbridge.cloud.base import BaseCloudProvider
 from cloudbridge.cloud.base.helpers import get_env