-
- datacenter = self._client.vim.get_datacenter(account)
- if datacenter is None:
- raise NotFound("cannot find datacenter account {}".format(account))
+
+ if self._client._so_version == 'v3':
+ datacenter, resource_orchestrator = self._client.vim.get_datacenter(account)
+ if datacenter is None or resource_orchestrator is None:
+ raise NotFound("cannot find datacenter account {}".format(account))
+ if 'uuid' not in datacenter:
+ raise NotFound("The RO Datacenter - {} is invalid. Please select another".format(account))
+ else:
+ # Backwards Compatiility
+ datacenter = self._client.vim.get_datacenter(account)
+ if datacenter is None:
+ raise NotFound("cannot find datacenter account {}".format(account))