community.general icon indicating copy to clipboard operation
community.general copied to clipboard

Add VM id and VM host to opennebula inventory data

Open aioue opened this issue 1 year ago • 4 comments

SUMMARY
To enable greater use of the inventory, add the ID of the VM, and the hostname of the host the VM is running on to the inventory output
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
opennebula.py
ADDITIONAL INFORMATION
                "host": "foo23.host",
                "id": 1234,

aioue avatar Jun 17 '24 16:06 aioue

cc @feldsam click here for bot help

ansibullbot avatar Jun 17 '24 16:06 ansibullbot

Not sure why the tests are failing as I'm not adding a new import for the pyone library...?

aioue avatar Jun 17 '24 17:06 aioue

Hi, problem is, that you added new method which is calling pyone package. To pass test, you need to also update tests to reflect this.

Anyway, for such infromation - host on which is VM running, there is easier method to get this. It is already in VM object, in history records, you just need to get last history record of VM to get host. So no need to do aditional api call and searching for host.

feldsam avatar Jun 20 '24 19:06 feldsam

@feldsam updated PR to reflect the new information you provided. It's a very simple PR now!

I'm afraid I don't understand how to fix the tests.

aioue avatar Jul 02 '24 13:07 aioue

@abakanovskii noticed you've created a few OpenNebula PRs with good tests. Any chance you could take a look at this small inventory improvement please?

aioue avatar Oct 01 '24 11:10 aioue

Hello @aioue! See comments below, I will commit them if you don't mind

abakanovskii avatar Oct 01 '24 13:10 abakanovskii

@aioue Could you provide me access to your repository so I can commit changes directly to this PR?

abakanovskii avatar Oct 01 '24 13:10 abakanovskii

@aioue Could you provide me access to your repository so I can commit changes directly to this PR?

Thank you! Have invited you as a collaborator.

aioue avatar Oct 01 '24 14:10 aioue

@aioue this PR contains the following merge commits:

  • https://github.com/ansible-collections/community.general/commit/43ed9c851db62f1a59fc471961f7bbadb420484a

Please rebase your branch to remove these commits.

click here for bot help

ansibullbot avatar Oct 01 '24 14:10 ansibullbot

@aioue This PR was evaluated as a potentially problematic PR for the following reasons:

  • More than 50 changed files.
  • More than 50 commits.

Such PR can only be merged by human. Contact a Core team member to review this PR on IRC: #ansible-devel on Libera.chat IRC

click here for bot help

ansibullbot avatar Oct 01 '24 15:10 ansibullbot

Made a mess of that rebase 🤦 I should learn more before trying this again.

aioue avatar Oct 01 '24 15:10 aioue

Made a mess of that rebase 🤦 I should learn more before trying this again.

haha, same thing happened to me before :)

abakanovskii avatar Oct 01 '24 15:10 abakanovskii

there was still a merge commit hanging, now it should be fine

abakanovskii avatar Oct 01 '24 15:10 abakanovskii

Thank you @abakanovskii 🙌

Appreciate your time and skilled help with this.

aioue avatar Oct 01 '24 15:10 aioue

Looks good to me as far as I can judge this. If nobody objects, I'll merge this on the weekend.

felixfontein avatar Oct 01 '24 19:10 felixfontein

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/24b74cc4b9976dd0e3cacf94316e4d131c409fbf/pr-8532

Backported as https://github.com/ansible-collections/community.general/pull/9003

🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.

patchback[bot] avatar Oct 07 '24 20:10 patchback[bot]

@aioue @abakanovskii thanks for your contribution! @feldsam @russoz thanks for reviewing!

felixfontein avatar Oct 07 '24 20:10 felixfontein

@felixfontein possibly silly question, but should the commit message leak email addresses like that?

aioue avatar Oct 08 '24 20:10 aioue

@aioue that's how GitHub works, if you don't tell it to hide your email address in commit messages. (https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line)

(I'm not sure whether the Co-authored-by: name <email> syntax is GitHub specific or also used elsewhere in the Git ecosystem.)

felixfontein avatar Oct 10 '24 19:10 felixfontein