Merge "Return None if no suitable datastore is found"

This commit is contained in:
Zuul 2019-03-07 11:20:16 +00:00 committed by Gerrit Code Review
commit d63ec1fe62
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ def get_recommended_datastore(session, sp_spec):
"RecommendDatastores",
session.vim.service_content.storageResourceManager,
storageSpec=sp_spec)
if not hasattr(spr, 'recommendations'):
LOG.error("Unable to find suitable datastore")
return
return spr.recommendations[0].key