From 9c13798f785b1a920eb7c703f659c94c45417b6f Mon Sep 17 00:00:00 2001 From: Stijn Seghers Date: Fri, 27 Mar 2020 18:55:13 +1300 Subject: [PATCH] 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. --- moto/ec2_instance_connect/models.py | 2 +- moto/rds2/models.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moto/ec2_instance_connect/models.py b/moto/ec2_instance_connect/models.py index cc8cc3f3..f3dbbe9f 100644 --- a/moto/ec2_instance_connect/models.py +++ b/moto/ec2_instance_connect/models.py @@ -1,4 +1,4 @@ -import boto +import boto.ec2 from moto.core import BaseBackend diff --git a/moto/rds2/models.py b/moto/rds2/models.py index 722d7d4f..7fa4f331 100644 --- a/moto/rds2/models.py +++ b/moto/rds2/models.py @@ -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":