Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] Repair virt_query outputter #65843

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tacerus
Copy link

@tacerus tacerus commented Jan 10, 2024

What does this PR do?

What issues does this PR fix or reference?

Fixes: #65841

Previous Behavior

Outputter returns traceback.

New Behavior

Outputter returns pretty output:

# salt-run --out=virt_query virt.query host=squanchy.infra.opensuse.org
squanchy.infra.opensuse.org
  thor1.infra.opensuse.org
    CPU: 1
    Memory: 1000000
    State: running
    Disk - vdb:
      Size: 2541887488
      File: /data0/kvm/disks/thor1.infra.opensuse.org_root.qcow2
      File Format: qcow2
    NIC - fe:cd:47:19:e7:86:
      Source: x-os-thor
      Type: direct
# more VMs ...

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

^ I'm not sure about tests for this, some other outputters have tests in tests/pytests/unit/output/, but I'm not sure it's feasible for this one, it would need to hook into the virt module tests somehow to generate a VM fixture?

Commits signed with GPG?

Yes

Existing code was not functional.
Only return if a dictionary is passed and reference the correct
data.

Signed-off-by: Georg Pfuetzenreuter <[email protected]>
Disk data in Libvirt VMs does not contain a disk size if the disk
references a block device.
Skip the field for such disks instead of failing with a key error.

Signed-off-by: Georg Pfuetzenreuter <[email protected]>
@tacerus tacerus requested a review from a team as a code owner January 10, 2024 22:37
@tacerus tacerus requested review from whytewolf and removed request for a team January 10, 2024 22:37
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Repair virt_query outputter [master] Repair virt_query outputter Jan 10, 2024
@dwoz dwoz added this to the Argon v3008.0 milestone Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] virt_query outputter returns traceback
2 participants