Skip to content

Wrong return_code in analyze boot #4245

@aciba90

Description

@aciba90

Bug report

The return_code of cloud-init analyze boot is 1, despite being able to successfully collect the information. I would expect a 0 exit code.

Steps to reproduce the problem

import logging

import pycloudlib
from pycloudlib import GCE

logging.basicConfig(level=logging.DEBUG)
cloud = GCE("test")
image = cloud.daily_image("focal")
inst = cloud.launch(image, wait=True)
r = inst.execute("cloud-init analyze boot")

>>> print(f"return_code={r.return_code}\nstdout={r.stdout}\nstderr={r.stderr}")
return_code=1
stdout=-- Most Recent Boot Record --
    Kernel Started at: 2023-07-13 08:35:45.578054
    Kernel ended boot at: 2023-07-13 08:35:46.914189
    Kernel time to boot (seconds): 1.336134910583496
    Cloud-init activated by systemd at: 2023-07-13 08:35:51.063430
    Time between Kernel end boot and Cloud-init activation (seconds): 4.149240970611572
    Cloud-init start: 2023-07-13 08:35:52.504000
stderr=successful

inst.delete(wait=False)

Environment details

  • Cloud-init version: 23.1.2-0ubuntu0~20.04.2
  • Operating System Distribution: Ubuntu 20.04
  • Cloud provider, platform or installer type: GCE

cloud-init logs

cloud-init.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlygood first issuehacktoberfestIssues to be completed during Hacktoberfest. Curated list of good first issue tags.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions