Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Jun 2, 2022
1 parent 950d454 commit c91c923
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def check_python_version() -> None:


def check_zap(master: bool = False) -> str:
"""Produces hash of ZAP submodule
"""Produces hash of ZAP submodule.
Args:
master: check branch master instead of current branch
master: Check branch master instead of current branch.
Returns:
SHA of zap submodule
SHA of zap submodule.
"""
shell.run_cmd(f"cd {_REPO_BASE_PATH}")
if master:
Expand All @@ -116,10 +116,9 @@ def check_zap(master: bool = False) -> str:
return_cmd_output=True).replace("\n", "")
command = f"git ls-tree {branch} third_party/zap/repo"
zap_commit = shell.run_cmd(command, return_cmd_output=True)
flush_print(f"Raw zap commit {zap_commit}")
zap_commit = zap_commit.split(" ")[2]
zap_commit = zap_commit[:zap_commit.index("\t")]
flush_print(f"zap commit: {zap_commit}")
flush_print(f"found zap commit: {zap_commit}")
return zap_commit


Expand All @@ -129,8 +128,8 @@ def generate_device_manifest(
"""Produces dictionary containing md5 of device dir zap files.
Args:
write_manifest_file: Serialize manifest in file and tree
zap_check_master: deprecated - check master instead of HEAD for zap
write_manifest_file: Serialize manifest in file and tree.
zap_check_master: Check master instead of HEAD for zap.
Returns:
Dict containing MD5 of device dir zap files.
"""
Expand Down Expand Up @@ -171,13 +170,11 @@ def load_cicd_config() -> Dict[str, Any]:
def flush_print(
to_print: str,
with_border: bool = False) -> None:
"""Prints and flushes stdout buffer
"""Prints and flushes stdout buffer.
Args:
to_print: The string to print
with_border: Add boarder above and below to_print
Returns:
None
to_print: The string to print.
with_border: Add boarder above and below to_print.
"""
if with_border:
border = ('-' * 64) + '\n'
Expand Down Expand Up @@ -389,7 +386,6 @@ def main(argv: Sequence[str]) -> None:

if options.build_all:
# TODO
# Needs testing after refactor
# Needs to call per-platform bundle function
flush_print("Build all disabled")
exit(1)
Expand Down

0 comments on commit c91c923

Please sign in to comment.