Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cloudinit/analyze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_parser(
return parser


def analyze_boot(name: str, args: argparse.Namespace) -> str:
def analyze_boot(name: str, args: argparse.Namespace) -> int:
"""Report a list of how long different boot operations took.

For Example:
Expand Down Expand Up @@ -199,7 +199,7 @@ def analyze_boot(name: str, args: argparse.Namespace) -> str:

outfh.write(status_map[status_code].format(**kwargs))
clean_io(infh, outfh)
return status_code
return 1 if status_code == show.FAIL_CODE else 0


def analyze_blame(name, args: argparse.Namespace) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/analyze/test_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_container_no_ci_log_line(self, m_is_container, m_subp):
finish_code = analyze_boot(name_default, args)

self.remove_dummy_file(path, log_path)
assert FAIL_CODE == finish_code
assert 1 == finish_code

@mock.patch("cloudinit.util.is_container", return_value=True)
@mock.patch("cloudinit.subp.subp", return_value=("U=1000000", None))
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_container_ci_log_line(self, m_is_container, m_subp, m_get, m_g):
finish_code = analyze_boot(name_default, args)

self.remove_dummy_file(path, log_path)
assert CONTAINER_CODE == finish_code
assert 0 == finish_code

@mock.patch("cloudinit.analyze.show.SystemctlReader")
@pytest.mark.parametrize(
Expand Down
Loading