Remove LVM PV signatures from a given block device.

    :param block_device: str: Full path of block device to scrub.
961346
def remove_lvm_physical_volume(block_device):
    '''
    
    '''
    p = Popen(['pvremove', '-ff', block_device],
              stdin=PIPE)
    p.communicate(input='y\n')
341476
def remove(self):
        '''
        
        '''
        print 'remove'
        if self.exists():
            print 'cleaning', self.venv
            run('rm -rf {}'.format(self.venv))
1226601
def remove(self, block_id):
        
        with self._mutex:
            entry = self._block_map[block_id]
            self._queue.remove(entry)
1257357
def delete(self, device_id: int):
        
        device = self._get_or_abort(device_id)
        session.delete(device)
        session.commit()
        return '', 204
547092
def _renderBlockDevice(self, block_device, build):
        """"""
        rendered_block_device = yield build.render(block_device)
        if rendered_block_device['volume_size'] is None:
            source_type = rendered_block_device['source_type']
            source_uuid = rendered_block_device['uuid']
            volume_size = self._determineVolumeSize(source_type, source_uuid)
            rendered_block_device['volume_size'] = volume_size
        return rendered_block_device
1373131
def delete_pb_devices():
    """"""
    parser = argparse.ArgumentParser(description='Register PB devices.')
    parser.add_argument('num_pb', type=int,
                        help='Number of PBs devices to register.')
    args = parser.parse_args()

    log = logging.getLogger('sip.tango_control.subarray')
    tango_db = Database()
    log.info("Deleting PB devices:")
    for index in range(args.num_pb):
        name = 'sip_sdp/pb/{:05d}'.format(index)
        log.info("\t%s", name)
        tango_db.delete_device(name)
1090778
def destroy(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name, reservation_id):
        
        # disconnect
        self._disconnect_all_my_connectors(session=session, resource_name=vm_name, reservation_id=reservation_id,
                                           logger=logger)
        # find vm
        vm = self.pv_service.find_by_uuid(si, vm_uuid)

        if vm is not None:
            # destroy vm
            result = self.pv_service.destroy_vm(vm=vm, logger=logger)
        else:
            logger.info("Could not find the VM {0},will remove the resource.".format(vm_name))
            result = True

        # delete resources
        self.resource_remover.remove_resource(session=session, resource_full_name=vm_name)
        return result
617938
def _list_devices(self, df_output):
        
        all_devices = [l.strip().split() for l in df_output.splitlines()]

        # Skip the header row and empty lines.
        raw_devices = [l for l in all_devices[1:] if l]

        # Flatten the disks that appear in the mulitple lines.
        flattened_devices = self._flatten_devices(raw_devices)

        # Filter fake or unwanteddisks.
        return [d for d in flattened_devices if self._keep_device(d)]
499130
async def RemoveBlocks(self, all_):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Controller',
                   request='RemoveBlocks',
                   version=5,
                   params=_params)
        _params['all'] = all_
        reply = await self.rpc(msg)
        return reply
525283
def _convert(self, block_node):
        

        if not type(block_node) is BlockNode:
            return block_node

        block = self.project.factory.block(block_node.addr, block_node.size)

        ail_block = ailment.IRSBConverter.convert(block.vex, self._ail_manager)
        return ail_block
683996
void removePathAndBlocks(String src, List<BlockInfo> blocks) throws IOException {
    // No need for lock until we start accepting requests from clients.
    assert (!nameNode.isRpcServerRunning() || hasWriteLock());
    leaseManager.removeLeaseWithPrefixPath(src);
    removeBlocks(blocks);
  }
1285060
def _initBlockMajorMap(self):
        
        self._mapMajorDevclass = {}
        try:
            fp = open(devicesFile, 'r')
            data = fp.read()
            fp.close()
        except:
            raise IOError('Failed reading device information from file: %s'
                          % devicesFile)
        skip = True
        for line in data.splitlines():
            if skip:
                if re.match('block.*:', line, re.IGNORECASE):
                    skip = False
            else:
                mobj = re.match('\s*(\d+)\s+([\w\-]+)$', line)
                if mobj:
                    major = int(mobj.group(1))
                    devtype = mobj.group(2)
                    self._mapMajorDevclass[major] = devtype
                    if devtype == 'device-mapper':
                        self._dmMajorNum = major
37163
def set_bpf_filter_on_all_devices(filterstr):
        '''
        
        '''
        with PcapLiveDevice._lock:
            for dev in PcapLiveDevice._OpenDevices.values():
                _PcapFfi.instance()._set_filter(dev, filterstr)
1231454
def _remove_trustee(self, device):
        '''
        '''

        trustee_name = get_device_info(device).name
        name_object_map = get_device_names_to_objects(self.devices)
        delete_func = self._get_delete_trustee_cmd

        for truster in self.domain:
            if trustee_name in self.domain[truster] and \
                    truster != trustee_name:
                truster_obj = name_object_map[truster]
                self._modify_trust(truster_obj, delete_func, trustee_name)
            self._populate_domain()

        for trustee in self.domain[trustee_name]:
            if trustee_name != trustee:
                self._modify_trust(device, delete_func, trustee)

        self.devices.remove(name_object_map[trustee_name])
154130
def _clean_block(response_dict):
    '''  '''
    response_dict['received_time'] = parser.parse(response_dict['received_time'])
    response_dict['time'] = parser.parse(response_dict['time'])

    return response_dict
676380
def delete_all_hosting_devices_by_template(self, context, template,
                                               force_delete=False):
        """"""
        plugging_drv = self.get_hosting_device_plugging_driver(
            context, template['id'])
        hosting_device_drv = self.get_hosting_device_driver(context,
                                                            template['id'])
        if plugging_drv is None or hosting_device_drv is None:
            return
        is_vm = template['host_category'] == VM_CATEGORY
        query = context.session.query(hd_models.HostingDevice)
        query = query.filter(hd_models.HostingDevice.template_id ==
                             template['id'])
        for hd in query:
            if not (hd.auto_delete or force_delete):
                # device manager is not responsible for life cycle
                # management of this hosting device.
                continue
            res = plugging_drv.get_hosting_device_resources(
                context, hd.id, hd.complementary_id, self.l3_tenant_id(),
                self.mgmt_nw_id())
            if is_vm:
                self.svc_vm_mgr.delete_service_vm(context, hd.id)
            plugging_drv.delete_hosting_device_resources(
                context, self.l3_tenant_id(), **res)
            with context.session.begin(subtransactions=True):
                # remove all allocations in this hosting device
                context.session.query(hd_models.SlotAllocation).filter_by(
                    hosting_device_id=hd['id']).delete()
                context.session.delete(hd)
858874
def _clear_block_deco(self):
        """"""
        for deco in self._block_decos:
            self.editor.decorations.remove(deco)
        self._block_decos[:] = []