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

Feature/standardize pyvmomi method names #88

Conversation

mikemorency
Copy link
Collaborator

SUMMARY

This is preparing the pymomi module utils to be made public. There are two main changes in this PR, all relating to module_utils/_vmware

  1. Standardize the get__by_name_or_moid methods. These methods are all very similar but some slightly differ just because they were written at different times. This change updates the names to be both descriptive and similar to one another, updates documentation for the methods to be similar to one another, and adds an optional parameter to throw a standard error if the search comes back empty

  2. list_all_objs_by_type doesnt match the get_ method name pattern we have and needlessly return a dict. Updated the name to be get_all.... and changed the return value to a list, like the other methods

There should be no change in functionality.

I am not able to update the rest utils yet. I think i see some possible bugs with the current methods and I want to confirm and fix those first

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

module_utils/_vmware

@mikemorency mikemorency requested a review from mariolenz December 4, 2024 20:08
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 16.32653% with 41 lines in your changes missing coverage. Please review.

Project coverage is 27.40%. Comparing base (94ea806) to head (411a1d5).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
plugins/module_utils/_vmware.py 27.58% 21 Missing ⚠️
plugins/modules/cluster_info.py 0.00% 4 Missing ⚠️
plugins/modules/cluster_vcls.py 0.00% 4 Missing ⚠️
plugins/modules/cluster.py 0.00% 2 Missing ⚠️
plugins/modules/cluster_dpm.py 0.00% 2 Missing ⚠️
plugins/modules/cluster_drs.py 0.00% 2 Missing ⚠️
plugins/modules/cluster_drs_recommendations.py 0.00% 2 Missing ⚠️
plugins/modules/folder_template_from_vm.py 0.00% 2 Missing ⚠️
plugins/modules/vm_portgroup_info.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
- Coverage   27.48%   27.40%   -0.08%     
==========================================
  Files          24       24              
  Lines        2059     2065       +6     
  Branches      385      387       +2     
==========================================
  Hits          566      566              
- Misses       1493     1499       +6     
Flag Coverage Δ
sanity 27.40% <16.32%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mikemorency mikemorency merged commit bb1aba5 into ansible-collections:main Dec 16, 2024
11 of 13 checks passed
@mikemorency mikemorency deleted the feature/standardize-pyvmomi-method-names branch December 16, 2024 13:51
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