saltstack / saltstack/salt

[BUG] virt.get_graphics returns single dictionary

Open
#59,234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity-low
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
virt.get_graphics returns only single dictionary even if virtual machine has multiple graphics devices.

Steps to Reproduce the behavior

salt 'vmm01*' virt.get_graphics vm-test
vm-test:
    ----------
    autoport:
        yes
    keymap:
        None
    listen:
        127.0.0.1
    port:
        5911
    type:
        vnc
vmm01# virsh dumpxml vm-test
<domain type='kvm' id='42'>
...
  <devices>
    <graphics type='spice' port='5910' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
    <graphics type='vnc' port='5911' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
  </devices>
...
</domain>

Expected behavior
graphics should be list of dictionaries, the same as it is with nics or disks

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3002.2

Dependency Versions:
          cffi: 1.11.5
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.14
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Dec  3 2020, 18:11:24)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 19.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.3

System Versions:
          dist: centos 8
        locale: UTF-8
       machine: x86_64
       release: 4.18.0-259.el8.x86_64
        system: Linux
       version: CentOS Stream 8

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the virt.get_graphics entry point and compare its result handling with the nics or disks behavior mentioned in the issue. Reproduce the case with multiple graphics devices, then add coverage and verify that the result contains one dictionary per graphics device.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.