Delete the raid configuration on the hardware.

        Loops through each SmartStorageConfig controller and clears the
        raid configuration.

        :raises: IloError, on an error from iLO.
480213
def delete_raid(self):
        
        self.check_smart_storage_config_ids()
        any_exceptions = []
        ld_exc_count = 0
        for config_id in self.smart_storage_config_identities:
            try:
                ssc_obj = self.get_smart_storage_config(config_id)
                ssc_obj.delete_raid()
            except exception.IloLogicalDriveNotFoundError as e:
                ld_exc_count += 1
            except sushy.exceptions.SushyError as e:
                any_exceptions.append((config_id, str(e)))

        if any_exceptions:
            msg = ('The Redfish controller failed to delete the '
                   'raid configuration in one or more controllers with '
                   'Error: %(error)s' % {'error': str(any_exceptions)})
            raise exception.IloError(msg)

        if ld_exc_count == len(self.smart_storage_config_identities):
            msg = ('No logical drives are found in any controllers. Nothing '
                   'to delete.')
            raise exception.IloLogicalDriveNotFoundError(msg)
49054
def delete_raid_configuration(irmc_info):
    
    # Attempt to get raid configuration on BM Server
    raid_adapter = get_raid_adapter(irmc_info)
    existing_logical_drives = _get_existing_logical_drives(raid_adapter)
    # Ironic requires delete_configuration first. Will pass if blank raid
    # configuration in server.
    if not existing_logical_drives:
        return
    raid_adapter['Server']['HWConfigurationIrmc'].update({
        '@Processing': 'execute'})
    logical_drive = raid_adapter['Server']['HWConfigurationIrmc'][
        'Adapters']['RAIDAdapter'][0]['LogicalDrives']['LogicalDrive']

    for drive in logical_drive:
        drive['@Action'] = 'Delete'

    # Attempt to delete logical drive in the raid config
    session = elcm_profile_set(irmc_info, raid_adapter)
    # Monitoring raid config delete session until done.
    session_timeout = irmc_info.get('irmc_raid_session_timeout',
                                    RAID_CONFIG_SESSION_TIMEOUT)
    _process_session_data(irmc_info, 'CONFIG_RAID', session['Session']['Id'],
                          session_timeout)

    # Attempt to delete raid adapter
    elcm_profile_delete(irmc_info, PROFILE_RAID_CONFIG)
256820
def purge_configs():
    
    user_config = path(CONFIG_FILE_NAME, root=USER)
    inplace_config = path(CONFIG_FILE_NAME)

    if os.path.isfile(user_config):
        os.remove(user_config)

    if os.path.isfile(inplace_config):
        os.remove(inplace_config)
615431
def clean(config):
    
    if not exists(config):
        logger.debug("Wily cache does not exist, skipping")
        return
    shutil.rmtree(config.cache_path)
    logger.debug("Deleted wily cache")
1252829
def disconnect(self):
        
        old_api = object.__getattribute__(self, '_api')
        new_api = API.build_hardware_simulator(
            loop=old_api._loop,
            config=copy.copy(old_api.config))
        setattr(self, '_api', new_api)
142454
def discard_config(self):
        """"""
        self.device.cu.rollback(rb_id=0)
        if not self.lock_disable and not self.session_config_lock:
            self._unlock()
272416
def remove(self, sid):
        
        self.dbcur.execute(SQL_SENSOR_DEL, (sid,))
        self.dbcur.execute(SQL_TMPO_DEL, (sid,))
1166402
def deleteFrom(self, organization, devices):
        
        for device in devices:
            url = self.BASE_URL+self.BASE_PATH+self.ORGS_PATH+"/"+ str(organization["id"]) + self.DEVICES_PATH+ "/" + str(device["id"]) + self.USER_QUERY
            response = self.requests.delete(url, auth=(self.__username, self.__password))
            response.raise_for_status()
38591
public void wipeInMemorySettings() {
    this.waitUntilInitialized();

    syncLock.lock();
    try {
      this.instanceChangeStreamListener.stop();
      if (instancesColl.find().first() == null) {
        throw new IllegalStateException("expected to find instance configuration");
      }
      this.syncConfig = new InstanceSynchronizationConfig(configDb);
      this.instanceChangeStreamListener = new InstanceChangeStreamListenerImpl(
          syncConfig,
          service,
          networkMonitor,
          authMonitor
      );
      this.isConfigured = false;
      this.stop();
    } finally {
      syncLock.unlock();
    }
  }
207580
def clear_data(self):
        
        if (self.get_data_metadata().is_read_only() or
                self.get_data_metadata().is_required()):
            raise errors.NoAccess()
        if self._my_map['data'] == self._data_default:
            return
        dbase = JSONClientValidated('repository',
                                    runtime=self._runtime).raw()
        filesys = gridfs.GridFS(dbase)
        filesys.delete(self._my_map['data'])
        self._my_map['data'] = self._data_default
        del self._my_map['base64']
1002588
def remove_handler_if_not_configured(self, dict_config, requested_handlers, handler_name, check_key) -> None:
        
        try:
            if not dict_config["handlers"][handler_name][check_key]:
                dict_config["handlers"].pop(handler_name)
                if handler_name in requested_handlers:
                    requested_handlers.remove(handler_name)
        except KeyError:
            # Ignore key errors
            pass
218883
def clean(self, config=True, catalog=False, check=False):
        

        try:
            if (config):
                os.unlink(self.config['FILTER_NAME'])
                os.unlink(self.config['PARAMETERS_NAME'])
                os.unlink(self.config['STARNNW_NAME'])
                os.unlink(self.config['CONFIG_FILE'])
            if (catalog):
                os.unlink(self.config['CATALOG_NAME'])
            if (check):
                os.unlink(self.config['CHECKIMAGE_NAME'])

        except OSError:
            pass
1354624
def close(self):
        

        for nio in self._nios:
            if nio:
                yield from nio.close()

        try:
            yield from Bridge.delete(self)
            log.info('Ethernet hub "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
        except DynamipsError:
            log.debug("Could not properly delete Ethernet hub {}".format(self._name))
        if self._hypervisor and not self._hypervisor.devices:
            yield from self.hypervisor.stop()
            self._hypervisor = None
        return True
1128115
def do_remove(config, config_dir):
    
    if not os.path.exists(config_dir):
        print "Configuration '{}' does not exist.".format(config)
        exit(1)
    if confirm("Confirm removal of the configuration '{}'".format(config)):
        shutil.rmtree(config_dir)
        print "Configuration '{}' has been removed.".format(config)
    else:
        print "Removal cancelled."
158483
def read_raid(self, controller=None):
        
        if controller:
            if not self.logical_drives:
                msg = ('No logical drives found on the controller')
                LOG.debug(msg)
                raise exception.IloLogicalDriveNotFoundError(msg)
            raid_op = 'create_raid'
        else:
            raid_op = 'delete_raid'

        result, raid_message = self._check_smart_storage_message()

        if result:
            configured_raid_settings = self._conn.get(self.settings_uri)
            raid_data = {
                'logical_disks': self._generic_format(
                    configured_raid_settings.json(), controller=controller)}
            return raid_data
        else:
            if self.physical_drives is None or not raid_message:
                # This controller is not configured or controller
                # not used in raid operation
                return
            else:
                msg = ('Failed to perform the %(opr)s operation '
                       'successfully. Error - %(error)s'
                       % {'opr': raid_op, 'error': str(raid_message)})
                raise exception.IloError(msg)
697109
def _cleanup(self):
        '''
        
        '''
        if (hasattr(self, 'config')
           and self.config.get('support_archive')
           and os.path.exists(self.config['support_archive'])):
            self.out.warning('Terminated earlier, cleaning up')
            try:
                os.unlink(self.config['support_archive'])
            except Exception as err:
                log.debug(err)
                self.out.error('{} while cleaning up.'.format(err))
753030
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/equipment/%s/', ids)
        return super(ApiEquipment, self).delete(url)