Fix import errors

For Python 2, the lazy importing style uncovered some importing
mistakes. I can't quite figure out how it was working before.
This commit is contained in:
Stijn Seghers 2020-03-27 18:55:13 +13:00
parent 1fc208e52c
commit 9c13798f78
No known key found for this signature in database
GPG Key ID: BF6A2BFEA196E7B6
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import boto
import boto.ec2
from moto.core import BaseBackend

View File

@ -8,7 +8,6 @@ from collections import defaultdict
from boto3 import Session
from jinja2 import Template
from re import compile as re_compile
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
from moto.compat import OrderedDict
from moto.core import BaseBackend, BaseModel
from moto.core.utils import get_random_hex
@ -308,6 +307,9 @@ class Database(BaseModel):
setattr(self, key, value)
def get_cfn_attribute(self, attribute_name):
# Local import to avoid circular dependency with cloudformation.parsing
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
if attribute_name == "Endpoint.Address":
return self.address
elif attribute_name == "Endpoint.Port":