data['QoS_support'] = False
self._stats = data
- def accept_transfer(self, volume, new_user, new_project):
+ def accept_transfer(self, context, volume, new_user, new_project):
pass
if 'result' not in data:
raise exception.SolidFireAPIDataException(data=data)
+
+ def accept_transfer(self, context, volume,
+ new_user, new_project):
+
+ sfaccount = self._get_sfaccount(volume['project_id'])
+ params = {'accountID': sfaccount['accountID']}
+ sf_vol = self._get_sf_volume(volume['id'], params)
+
+ if new_project != volume['project_id']:
+ # do a create_sfaccount here as this tenant
+ # may not exist on the cluster yet
+ sfaccount = self._create_sfaccount(new_project)
+
+ params = {
+ 'volumeID': sf_vol['volumeID'],
+ 'accountID': sfaccount['accountID']
+ }
+ data = self._issue_api_request('ModifyVolume',
+ params, version='5.0')
+
+ if 'result' not in data:
+ raise exception.SolidFireAPIDataException(data=data)
+
+ LOG.debug(_("Leaving SolidFire transfer volume"))
"""
-import sys
import time
-import traceback
from oslo.config import cfg
-from cinder.brick.initiator import connector as initiator
from cinder import context
from cinder import exception
from cinder.image import glance
# NOTE(jdg): need elevated context as we haven't "given" the vol
# yet
volume_ref = self.db.volume_get(context.elevated(), volume_id)
- self.driver.accept_transfer(volume_ref, new_user, new_project)
+ self.driver.accept_transfer(context, volume_ref, new_user, new_project)
def _migrate_volume_generic(self, ctxt, volume, host):
rpcapi = volume_rpcapi.VolumeAPI()