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

Fix 'NameError: name 'datacenter_name' is not defined' in vmware_vm.relocate #280

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ggiesen
Copy link
Contributor

@ggiesen ggiesen commented May 23, 2022

Fixes bad variable reference by either allowing you to specify datacenter_name or by calling utils_datastore.get_datastores without it.

Fixes: #279

@waynew
Copy link
Contributor

waynew commented Jun 8, 2022

Okay, so obviously I like this change, I've been working to try and figure out how to adjust some things.

I mentioned this over in #255 but as you may know, we made some trade-offs at the start of the project that are rapidly needing to be traded... back on? 😂

Basically, for the integration tests, we need fixtures that will actually connect to vSphere and:

  1. create a test datacenter (assuming it doesn't exist already)
  2. create a/some test VMs (assuming they don't exist already)

There may be some other vSphere resources that we need -- I'm still not 100% comfortable will all the requirements when it comes to managing ESXi 😂 but I'm getting there.

One thing that we could do here is just write a simple unit test that mocks out the pyvmomi parts within the utils - that should be pretty easy to get to appropriately fail, so this fix can be tested -- at least if we want to merge before building out the full integration tests, which I'm fine with. As long as we have some test coverage to make sure that everything is being called in at least a reasonable fashion.

@vmwclabot
Copy link

@ggiesen, VMware has approved your signed contributor license agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: vmware_vm.relocate execution module gives error: "NameError: name 'datacenter_name' is not defined"
3 participants