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
vmware_guest: assign device keys from a sequence generator #57994
Conversation
for use with the VMware API. Switch all of the current vApp and device code that uses VMware API keys to use this new helper. Add keys from this help to all disk devices. This will be needed later for Storage Policy support.
@lparkes, just so you are aware we have a dedicated Working Group for vmware. |
The test
|
I don't recall saving this PR last night. That could easily have been kitten assisted and I have tidied up the text and I'll look at the pep8 failure now. |
def next_key(): | ||
PyVmomiKeyHelper.current_key -= 1 | ||
return PyVmomiKeyHelper.current_key | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I'm not sure you need a class for that. e.g:
>>> def foo():
... if hasattr(foo, 'cpt'):
... foo.cpt +=1
... else:
... foo.cpt = 0
... return foo.cpt
...
>>> foo()
0
>>> foo()
1
>>> foo()
2
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
SUMMARY
This PR adds a new class which contains a staticmethod that generates a sequence of integers for use as temporary client defined keys. I'm not convinced that the current system of ranges of random numbers will cope with assigning keys to disks and disks will need keys when we start using storage policies.
I'm using this PR to help discuss what we want to do.
ISSUE TYPE
COMPONENT NAME
vmware_guest
ADDITIONAL INFORMATION