def remove_all_line_from_device(device): provd_config_manager = provd_connector.config_manager() try: config = provd_config_manager.get(device.id) provd_converter.reset_config(config) provd_config_manager.update(config) except URLError as e: raise DataError.on_action('dissociate', 'LineDevice', e)
def remove_all_line_from_device(device): provd_config_manager = provd_connector.config_manager() try: config = provd_config_manager.get(device.id) provd_converter.reset_config(config) provd_config_manager.update(config) except URLError as e: raise ProvdError('error during remove all lines from device %s' % (device.id), e)
def _remove_line_from_device_sip(device, line): provd_config_manager = provd_connector.config_manager() config = provd_config_manager.get(device.id) if 'sip_lines' in config['raw_config']: del config['raw_config']['sip_lines'][str(line.device_slot)] if len(config['raw_config']['sip_lines']) == 0: provd_converter.reset_config(config) reset_to_autoprov(device) provd_config_manager.update(config)