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

VMware: fail module when unable to find the user specified folder #53474

Merged
merged 4 commits into from
Mar 8, 2019
Merged

VMware: fail module when unable to find the user specified folder #53474

merged 4 commits into from
Mar 8, 2019

Conversation

thefaftek
Copy link
Contributor

SUMMARY

Updating this to provide logs if a null/non-existent folder is presented. Currently the error message you receive is "msg": "Failed to move VM with exception 'NoneType' object has no attribute 'MoveInto'". This does not describe the issue occurring.

This purely looks at the folder variable after it reaches out to VMWare, and if the value is null exists instead of attempting a move using a null folder.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

vmware_guest_move

ADDITIONAL INFORMATION
  1. Attempt to move a VM using the below playbook, with an invalid folder path
  2. Review output.
Playbook:
- hosts: localhost
  gather_facts: false
  connection: local
  vars:

  tasks:
  - vmware_guest_move:
      datacenter: "{{datacenter}}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
      hostname: "{{vcenter_hostname}}"
      validate_certs: no
      name: "{{inventory_hostname}}"
      dest_folder: "{{dest_folder}}"

BEFORE: 
VM move fails, error "msg": "Failed to move VM with exception 'NoneType' object has no attribute 'MoveInto'"

Afterwards the VM move succeeds with standard success message.

Updating this to provide logs if a null/non-existent folder is presented. Currently the error message you receive is "msg": "Failed to move VM with exception 'NoneType' object has no attribute 'MoveInto'". This does not describe the issue occurring.
@ansibot
Copy link
Contributor

ansibot commented Mar 7, 2019

@ansibot
Copy link
Contributor

ansibot commented Mar 7, 2019

@thefaftek, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community labels Mar 7, 2019
Changing the dual equal signs to is to follow python best practices and pass tests.
Removing trailing whitespace
adding newline at end of file
@Akasurde Akasurde changed the title Update vmware_guest_move.py VMware: fail module when unable to find the user specified folder Mar 8, 2019
@Akasurde Akasurde self-assigned this Mar 8, 2019
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Mar 8, 2019
@Akasurde Akasurde merged commit b9ec7bb into ansible:devel Mar 8, 2019
@Akasurde
Copy link
Member

Akasurde commented Mar 8, 2019

@thefaftek Thanks for the contribution.

@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants