Remove Storage from a Server.

        The Storage must be a reference to an object in
        Server.storage_devices or the method will throw and Exception.

        A Storage from get_storage(uuid) will not work as it is missing the 'address' property.
488446
def remove_storage(self, storage):
        
        if not hasattr(storage, 'address'):
            raise Exception(
                ('Storage does not have an address. '
                 'Access the Storage via Server.storage_devices '
                 'so they include an address. '
                 '(This is due how the API handles Storages)')
            )

        self.cloud_manager.detach_storage(server=self.uuid, address=storage.address)
        self.storage_devices.remove(storage)
273486
def delete(self, bucket=None, ignore=False):
        

        # Make lists
        buckets = bucket
        if isinstance(bucket, six.string_types):
            buckets = [bucket]
        elif bucket is None:
            buckets = reversed(self.buckets)

        # Iterate over buckets
        for bucket in buckets:

            # Non existent bucket
            if bucket not in self.buckets:
                if not ignore:
                    message = 'Bucket "%s" doesn\'t exist' % bucket
                    raise tableschema.exceptions.StorageError(message)
                return

            # Remove from descriptors
            if bucket in self.__descriptors:
                del self.__descriptors[bucket]

            # Remove from dataframes
            if bucket in self.__dataframes:
                del self.__dataframes[bucket]
948973
def delete_object(self, obj):
        """"""
        if _debug: Application._debug("delete_object %r", obj)

        # extract the object name and identifier
        object_name = obj.objectName
        object_identifier = obj.objectIdentifier

        # delete it from the application
        del self.objectName[object_name]
        del self.objectIdentifier[object_identifier]

        # remove the object's identifier from the device's object list
        # if there is one and it has an object list property
        if self.localDevice and self.localDevice.objectList:
            indx = self.localDevice.objectList.index(object_identifier)
            del self.localDevice.objectList[indx]

        # make sure the object knows it's detached from an application
        obj._app = None
375485
def delete(self, bucket=None, ignore=False):
        

        # Make lists
        buckets = bucket
        if isinstance(bucket, six.string_types):
            buckets = [bucket]
        elif bucket is None:
            buckets = reversed(self.buckets)

        # Iterater over buckets
        for bucket in buckets:

            # Non-existent bucket
            if bucket not in self.buckets:
                if not ignore:
                    message = 'Bucket "%s" doesn\'t exist.' % bucket
                    raise tableschema.exceptions.StorageError(message)
                return

            # Remove from descriptors
            if bucket in self.__descriptors:
                del self.__descriptors[bucket]

            # Make delete request
            table_name = self.__mapper.convert_bucket(bucket)
            self.__service.tables().delete(
                projectId=self.__project,
                datasetId=self.__dataset,
                tableId=table_name).execute()

        # Remove tables cache
        self.__buckets = None
1107409
def _wipe_storage(self, address: Address) -> None:
        
        account_store = self._get_address_store(address)
        self._dirty_accounts.add(address)
        account_store.delete()
730400
def delete(self, bucket: str, key: str):
        
        bucket_obj = self._ensure_bucket_loaded(bucket)
        try:
            bucket_obj.delete_blob(key)
        except NotFound:
            return False
879124
def remove(self, server_id):
        
        server = self._storage.pop(server_id)
        server.stop()
        server.cleanup()
950003
def remove(self, cluster_id):
        
        cluster = self._storage.pop(cluster_id)
        cluster.cleanup()
1003214
def delete_blob(call=None, kwargs=None):  # pylint: disable=unused-argument
    '''
    
    '''
    if kwargs is None:
        kwargs = {}

    if 'container' not in kwargs:
        raise SaltCloudSystemExit(
            'A container must be specified'
        )

    if 'blob' not in kwargs:
        raise SaltCloudSystemExit(
            'A blob must be specified'
        )

    storageservice = _get_block_blob_service(kwargs)

    storageservice.delete_blob(kwargs['container'], kwargs['blob'])
    return True
161162
def remove_object(self, bucket_name, object_name):
        
        is_valid_bucket_name(bucket_name)
        is_non_empty_string(object_name)

        # No reason to store successful response, for errors
        # relevant exceptions are thrown.
        self._url_open('DELETE', bucket_name=bucket_name,
                       object_name=object_name)
242475
def delete_object(self, bucket, object_name):
        
        details = self._details(
            method=b"DELETE",
            url_context=self._url_context(bucket=bucket, object_name=object_name),
        )
        d = self._submit(self._query_factory(details))
        return d
895182
def delete(self, rid, raise_on_error=True):
        
        return self.ds.delete(rid, raise_on_error)
576092
def modify_server(self, UUID, **kwargs):
        
        body = dict()
        body['server'] = {}
        for arg in kwargs:
            if arg not in Server.updateable_fields:
                Exception('{0} is not an updateable field'.format(arg))
            body['server'][arg] = kwargs[arg]

        res = self.request('PUT', '/server/{0}'.format(UUID), body)
        server = res['server']

        # Populate subobjects
        IPAddresses = IPAddress._create_ip_address_objs(server.pop('ip_addresses'),
                                                          cloud_manager=self)

        storages = Storage._create_storage_objs(server.pop('storage_devices'),
                                                cloud_manager=self)

        return Server(
            server,
            ip_addresses=IPAddresses,
            storage_devices=storages,
            populated=True,
            cloud_manager=self
        )
160728
async def unmount(self, device):
        
        device = self._find_device(device)
        if not self.is_handleable(device) or not device.is_filesystem:
            self._log.warn(_('not unmounting {0}: unhandled device', device))
            return False
        if not device.is_mounted:
            self._log.info(_('not unmounting {0}: not mounted', device))
            return True
        self._log.debug(_('unmounting {0}', device))
        await device.unmount()
        self._log.info(_('unmounted {0}', device))
        return True
1299878
def RemoveDevice(self, object_path):
    ''' '''

    adapter = mockobject.objects[self.path]
    adapter.EmitSignal(ADAPTER_IFACE, 'DeviceRemoved',
                       'o', [object_path])
257559
def remove_device(self, request):
        """"""
        
        devices = self.__get_u2f_devices()

        for i in range(len(devices)):
            if devices[i]['keyHandle'] == request['id']:
                del devices[i]
                self.__save_u2f_devices(devices)
                
                return {
                    'status'  : 'ok', 
                    'message' : 'Successfully deleted your device!'
                }

        return {
            'status' : 'failed', 
            'error'  : 'No device with such an id been found!'
        }
58937
def delete_content_type_object(repo, content_type, uuid):
    
    storage_manager = StorageManager(repo)
    model_class = load_model_class(repo, content_type)
    model = storage_manager.get(model_class, uuid)
    commit = storage_manager.delete(model, 'Deleted via DELETE request.')
    return commit, model