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

Add ovirt_vm_os_info #26

Merged
merged 11 commits into from
Apr 17, 2020
Merged

Add ovirt_vm_os_info #26

merged 11 commits into from
Apr 17, 2020

Conversation

mnecas
Copy link
Member

@mnecas mnecas commented Apr 16, 2020

Add ovirt_vm_os_info as suggested in #24
Not sure if this is the best use case, but still wanted to add the PR where we could discuss it.

Right now the module return list of dictionaries which have attributes like name, architecture etc. in [1].
When I tried to get a list of all supported OS names it was so large list with all attributes that I did have to add filter_keys to filter the output. For example, the large_icon and small_icon attributes are unnecessary for ansible (you can check them in [1] or /ovirt-engine/api/operatingsystems).
To specific attributes like a name (you can check examples).

example of the output

 "ovirt_vm_os": [
        {
            "architecture": "x86_64",
            "description": "Other OS",
            "href": "/ovirt-engine/api/operatingsystems/0",
            "id": "0",
            "large_icon": {
                "href": "/ovirt-engine/api/icons/2ef463ea-7c28-49e1-b977-471eaf087d1e",
                "id": "2ef463ea-7c28-49e1-b977-471eaf087d1e"
            },
            "name": "other",
            "small_icon": {
                "href": "/ovirt-engine/api/icons/1f91726e-f467-463e-936a-46c19d6e96a2",
                "id": "1f91726e-f467-463e-936a-46c19d6e96a2"
            }
        },
        {
            "architecture": "x86_64",
            "description": "Windows XP",
            "href": "/ovirt-engine/api/operatingsystems/1",
            "id": "1",
            "large_icon": {
                "href": "/ovirt-engine/api/icons/e00ddcc3-2728-26a2-09b8-49740dfc7b9b",
                "id": "e00ddcc3-2728-26a2-09b8-49740dfc7b9b"
            },
            "name": "windows_xp",
            "small_icon": {
                "href": "/ovirt-engine/api/icons/8ef03a05-2ed5-12a2-efa1-eead0d9c0644",
                "id": "8ef03a05-2ed5-12a2-efa1-eead0d9c0644"
            }
        }
    ]

Questions

  • if I should only return simply a list of names or keep it like it is.
  • if I should return ovirt_vm_os or ovirt_vm_oss, because everywhere we return plural of it but don't like the doubles.

[1] http://ovirt.github.io/ovirt-engine-api-model/master/#types/operating_system_info

@mwperina @dangel101 @snecklifter

@snecklifter
Copy link
Contributor

Ah, ok, looks like we've both been working on the same thing! :)

snecklifter@f4c4733

As per the commit comment its mostly copy/paste from your vnic_profile_info module anyway. Let me know if you want to create a PR anyway.

@snecklifter
Copy link
Contributor

@mnecas filter keys is nice, my only other question would be whether you want to add a line to the other modules referencing this one in the same PR?
E.g. snecklifter@f4c4733#diff-e6ae0f16accf2aa74aee831940842301R151

Otherwise LGTM!

plugins/modules/ovirt_instance_type.py Outdated Show resolved Hide resolved
plugins/modules/ovirt_instance_type.py Outdated Show resolved Hide resolved
plugins/modules/ovirt_template.py Outdated Show resolved Hide resolved
plugins/modules/ovirt_vm.py Outdated Show resolved Hide resolved
plugins/modules/ovirt_vm_os_info.py Show resolved Hide resolved
Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mnecas mnecas merged commit 54a3dd0 into oVirt:master Apr 17, 2020
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.

3 participants