Skip to content

Commit

Permalink
feat: Moved settings reading after seal to ensure a validated parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
santiagosalamandri committed Sep 30, 2022
1 parent e4d0ed7 commit 17252a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion iso15118/evcc/evcc_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def load_envs(self, env_path: Optional[str] = None) -> None:
"MAX_SUPPORTING_POINTS", default=1024, validate=Range(min=0, max=1024)
)

env.seal() # raise all errors at once, if any
logger.info("EVCC settings:")
for key, value in shared_settings.items():
logger.info(f"{key:30}: {value}")
for key, value in env.dump().items():
logger.info(f"{key:30}: {value}")
env.seal() # raise all errors at once, if any


RESUME_SELECTED_AUTH_OPTION = None
Expand Down
2 changes: 1 addition & 1 deletion iso15118/secc/secc_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ def load_envs(self, env_path: Optional[str] = None) -> None:
# EV can still use value-added services while not consuming any power.
self.standby_allowed = env.bool("STANDBY_ALLOWED", default=False)

env.seal() # raise all errors at once, if any
logger.info("SECC settings:")
for key, value in shared_settings.items():
logger.info(f"{key:30}: {value}")
for key, value in env.dump().items():
logger.info(f"{key:30}: {value}")
env.seal() # raise all errors at once, if any

def load_requested_protocols(self, read_protocols: Optional[List[str]]):
protocols = format_list(read_protocols)
Expand Down
2 changes: 1 addition & 1 deletion iso15118/shared/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@

ENABLE_TLS_1_3 = env.bool("ENABLE_TLS_1_3", default=False)

shared_settings = env.dump()
env.seal() # raise all errors at once, if any
shared_settings = env.dump()

0 comments on commit 17252a1

Please sign in to comment.