vmware-archive / nsxansible

A set of example Ansible Modules using the above two projects as the basis
Other
109 stars 71 forks source link

deployNsx.yml error FAILED! => {"msg": "Unable to import vcenter_gather_moids due to inconsistent use of tabs and spaces in indentation"} #91

Closed boopathid closed 4 years ago

boopathid commented 4 years ago

Running deploy NSX with deployNsx.yml https://github.com/vmware/nsxansible/blob/master/deployNsx.yml, running into the below error

TASK [base-config-nsx : Connect NSX Manager to SSO] **** changed: [localhost]

TASK [base-config-nsx : Gather vCenter Mgmt Cluster moid] ** fatal: [localhost]: FAILED! => {"msg": "Unable to import vcenter_gather_moids due to inconsistent use of tabs and spaces in indentation"}

PLAY RECAP ***** localhost : ok=4 changed=4 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

The cluster, datacenter in the vCenter has no space or tab as the error says.

Any help?

boopathid commented 4 years ago

nsxansible/library/vcenter_gather_moids.py

line 41 and 42 has tabs, so python is throwing syntax error for it.

Deleted the tabs in these lines & did indentation with space. Now it works fine.

    elif re.search( searchedname, object.name ):
        return object