dell_storagecenter_driver/dell_storagecenter_api.py
def update_storage_profile(self, scvolume, storage_profile):
        """Update a volume's Storage Profile.

        Changes the volume setting to use a different Storage Profile. If
        storage_profile is None, will reset to the default profile for the
        cinder user account.

        :param scvolume: The Storage Center volume to be updated.
        :param storage_profile: The requested Storage Profile name.
        :returns: True if successful, False otherwise.
        """
        prefs = self._get_user_preferences()
        if not prefs:
            return False

        if not prefs.get('allowStorageProfileSelection'):
            LOG.error('User does not have permission to change '
                      'Storage Profile selection.')
            return False

        profile = self._find_storage_profile(storage_profile)
        if storage_profile:
            if not profile:
                LOG.error('Storage Profile %s was not found.',
                          storage_profile)
                return False
        else:
            # Going from specific profile to the user default
            profile = prefs.get('storageProfile')
            if not profile:
                LOG.error('Default Storage Profile was not found.')
                return False

        LOG.info('Switching volume %(vol)s to profile %(prof)s.',
                 {'vol': scvolume['name'],
                  'prof': profile.get('name')})
        payload = {}
        payload['StorageProfile'] = self._get_id(profile)
        r = self.client.post('StorageCenter/ScVolumeConfiguration'
                             '/%s/Modify'
                             % self._get_id(scvolume),
                             payload)
        if not self._check_result(r):
            LOG.error('Error changing Storage Profile for volume '
                      '%(original)s to %(name)s: %(code)d %(reason)s '
                      '%(text)s',
                      {'original': scvolume['name'],
                       'name': storage_profile,
                       'code': r.status_code,
                       'reason': r.reason,
                       'text': r.text})
            return False
        return True
Update a volume's Storage Profile.

        Changes the volume setting to use a different Storage Profile. If
        storage_profile is None, will reset to the default profile for the
        cinder user account.

        :param scvolume: The Storage Center volume to be updated.
        :param storage_profile: The requested Storage Profile name.
        :returns: True if successful, False otherwise.
        
Update a volume's Storage Profile.
Changes the volume setting to use a different Storage Profile. If
storage_profile is None, will reset to the default profile for the
cinder user account.
Update a volume ' s Storage Profile . Changes the volume setting to use a different Storage Profile . If storage_profile is None will reset to the default profile for the cinder user account .
def update_storage_profile(self, scvolume, storage_profile):
        prefs = self._get_user_preferences()
        if not prefs:
            return False
        if not prefs.get('allowStorageProfileSelection'):
            LOG.error('User does not have permission to change '
                      'Storage Profile selection.')
            return False
        profile = self._find_storage_profile(storage_profile)
        if storage_profile:
            if not profile:
                LOG.error('Storage Profile %s was not found.',
                          storage_profile)
                return False
        else:
            profile = prefs.get('storageProfile')
            if not profile:
                LOG.error('Default Storage Profile was not found.')
                return False
        LOG.info('Switching volume %(vol)s to profile %(prof)s.',
                 {'vol': scvolume['name'],
                  'prof': profile.get('name')})
        payload = {}
        payload['StorageProfile'] = self._get_id(profile)
        r = self.client.post('StorageCenter/ScVolumeConfiguration'
                             '/%s/Modify'
                             % self._get_id(scvolume),
                             payload)
        if not self._check_result(r):
            LOG.error('Error changing Storage Profile for volume '
                      '%(original)s to %(name)s: %(code)d %(reason)s '
                      '%(text)s',
                      {'original': scvolume['name'],
                       'name': storage_profile,
                       'code': r.status_code,
                       'reason': r.reason,
                       'text': r.text})
            return False
        return True
def update_storage_profile ( self , scvolume , storage_profile ) : prefs = self . _get_user_preferences ( ) if not prefs : return False if not prefs . get ( 'allowStorageProfileSelection' ) : LOG . error ( 'User does not have permission to change ' 'Storage Profile selection.' ) return False profile = self . _find_storage_profile ( storage_profile ) if storage_profile : if not profile : LOG . error ( 'Storage Profile %s was not found.' , storage_profile ) return False else : profile = prefs . get ( 'storageProfile' ) if not profile : LOG . error ( 'Default Storage Profile was not found.' ) return False LOG . info ( 'Switching volume %(vol)s to profile %(prof)s.' , { 'vol' : scvolume [ 'name' ] , 'prof' : profile . get ( 'name' ) } ) payload = { } payload [ 'StorageProfile' ] = self . _get_id ( profile ) r = self . client . post ( 'StorageCenter/ScVolumeConfiguration' '/%s/Modify' % self . _get_id ( scvolume ) , payload ) if not self . _check_result ( r ) : LOG . error ( 'Error changing Storage Profile for volume ' '%(original)s to %(name)s: %(code)d %(reason)s ' '%(text)s' , { 'original' : scvolume [ 'name' ] , 'name' : storage_profile , 'code' : r . status_code , 'reason' : r . reason , 'text' : r . text } ) return False return True
Update a volume's Storage Profile.
Update a volume ' s Storage Profile .
"""Update a volume's Storage Profile.

        Changes the volume setting to use a different Storage Profile. If
        storage_profile is None, will reset to the default profile for the
        cinder user account.

        :param scvolume: The Storage Center volume to be updated.
        :param storage_profile: The requested Storage Profile name.
        :returns: True if successful, False otherwise.
        """ # Going from specific profile to the user default
True if successful, False otherwise.
True if successful False otherwise .
self
scvolume
The Storage Center volume to be updated.
The Storage Center volume to be updated .
storage_profile
The requested Storage Profile name.
The requested Storage Profile name .