Skip to content

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Sep 7, 2023
1 parent 7725e36 commit 96d2c6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
11 changes: 5 additions & 6 deletions stack/hlsconstructs/step_function.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from typing import Any, Mapping

from aws_cdk import aws_iam, aws_stepfunctions, core
from aws_cdk import aws_iam, core
from hlsconstructs.lambdafunc import Lambda


Expand All @@ -18,8 +18,7 @@ def __init__(
assumed_by=aws_iam.ServicePrincipal("states.amazonaws.com"),
)

def addLambdasToRole(self, arguments):
for key in arguments:
arg = arguments[key]
if type(arg) == Lambda:
def addLambdasToRole(self, arguments: Mapping[str, Any]):
for arg in arguments.values():
if isinstance(arg, Lambda):
self.steps_role.add_to_policy(arg.invoke_policy_statement)
7 changes: 1 addition & 6 deletions stack/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,7 @@

def getenv(key, default):
value = os.getenv(key, default)
if value is None:
value = default
elif type(value) == str:
if len(value) == 0:
value = default
return value
return default if value == "" else value


# Optional env settings
Expand Down

0 comments on commit 96d2c6f

Please sign in to comment.