-# Copyright 2014 Dell Inc.
+# Copyright 2015 Dell Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
scserver)
self.unmap_volume(scvolume,
scserver)
+ break
def create_volume(self, name, size, ssn, volfolder):
'''This creates a new volume on the storage center. It
{'name': name,
'c': r.status_code,
'r': r.reason})
- if scvolume is not None:
- LOG.info(_LI('Created volume %(index)d: %(name)s'),
- {'index': scvolume['index'],
+ if scvolume:
+ LOG.info(_LI('Created volume %(instanceId)s: %(name)s'),
+ {'instanceId': scvolume['instanceId'],
'name': scvolume['name']})
+ else:
+ LOG.error(_LE('ScVolume returned success with empty payload.'
+ ' Attempting to locate volume'))
+ # In theory it is there since success was returned.
+ # Try one last time to find it before returning.
+ scvolume = self.find_volume(ssn, name, None)
+
return scvolume
def find_volume(self, ssn, name=None, instanceid=None):
'r': r.reason})
if vol is not None:
LOG.debug('Volume expanded: %(i)s %(s)s',
- {'i': vol['index'],
+ {'i': vol['instanceId'],
's': vol['configuredSize']})
return vol