Skip to content

Commit 2fe13c5

Browse files
authored
Merge pull request #122 from mikegrima/fixagain
Moved IAMbic imports to local imports
2 parents 4bb274f + e1f3186 commit 2fe13c5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/starfleet/worker_ships/plugins/iam/role_ship.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
make_iambic_variables,
3838
)
3939
from starfleet.worker_ships.ship_schematics import StarfleetWorkerShip, FanOutStrategy, AlertPriority
40-
from starfleet.worker_ships.plugins.iam.iambic_imports import AWSAccount, AwsIamRoleTemplate, iambic_ctx
4140

4241

4342
class IambicFailedError(Exception):
@@ -65,13 +64,17 @@ def render_iambic_template(self, commit: bool = False) -> Dict[str, Any]:
6564
"""This will render the iambic template and return it back out."""
6665
return render_iambic_template(self.payload, IambicTemplateTypes.IAM_ROLE, commit)
6766

68-
def prepare_iambic_template(self, rendered_template: Dict[str, Any]) -> AwsIamRoleTemplate:
67+
def prepare_iambic_template(self, rendered_template: Dict[str, Any]) -> "AwsIamRoleTemplate":
6968
"""This will perform the additional validation that is needed to load and generate the iambic template."""
69+
from starfleet.worker_ships.plugins.iam.iambic_imports import AwsIamRoleTemplate
70+
7071
AwsIamRoleTemplate.update_forward_refs()
7172
return AwsIamRoleTemplate(**rendered_template)
7273

7374
def execute(self, commit: bool = False) -> None:
7475
"""Execute the payload to sync out."""
76+
from starfleet.worker_ships.plugins.iam.iambic_imports import AWSAccount, iambic_ctx
77+
7578
config = self.configuration_template_class().load(STARFLEET_CONFIGURATION.config[self.worker_ship_name])
7679

7780
# Pull out the payload details for this account:

src/starfleet/worker_ships/plugins/iam/schemas.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from starfleet.utils.logging import LOGGER
1616
from starfleet.worker_ships.base_payload_schemas import IncludeAccountsSpecificationSchema, AccountsSpecificationSchema, BaseAccountPayloadTemplate
1717
from starfleet.worker_ships.ship_schematics import WorkerShipBaseConfigurationTemplate
18-
from starfleet.worker_ships.plugins.iam.iambic_imports import Variable
1918

2019

2120
class IambicTemplateTypes(Enum):
@@ -69,8 +68,9 @@ def render_iambic_template(template: Dict[str, Any], template_type: IambicTempla
6968
return rendered_template
7069

7170

72-
def make_iambic_variables(template_variables: List[Dict[str, str]]) -> List[Variable]:
71+
def make_iambic_variables(template_variables: List[Dict[str, str]]) -> List["Variable"]:
7372
"""This will make the iambic variable objects from the Starfleet template variables."""
73+
from starfleet.worker_ships.plugins.iam.iambic_imports import Variable
7474

7575
iambic_variables = []
7676
for variable in template_variables:

0 commit comments

Comments
 (0)