Don't fail listing vSphere nodes when uuid is not available for a vm
@@ -504,7 +504,9 @@ class VSphereNodeDriver(NodeDriver):
if 'Microsoft' in str(operating_system):
os_type = 'windows'
uuid = vm.get('summary.config.instanceUuid') or \
- vm.get('obj').config.instanceUuid
+ (vm.get('obj').config and vm.get('obj').config.instanceUuid)
+ if not uuid:
+ logger.error('No uuid for vm:', vm)
annotation = vm.get('summary.config.annotation')
state = vm.get('summary.runtime.powerState')
status = self.NODE_STATE_MAP.get(state, NodeState.UNKNOWN)
