cwe
stringclasses
9 values
func_name
stringclasses
551 values
func_src_before
stringlengths
72
114k
func_src_after
stringclasses
576 values
line_changes
stringclasses
576 values
char_changes
stringclasses
574 values
commit_link
stringclasses
430 values
file_name
stringclasses
411 values
vul_type
stringclasses
9 values
num_tokens
float64
16
28.1k
⌀
refactored
bool
2 classes
parsing_score
bool
2 classes
generated
bool
2 classes
cwe-078
null
def start_processes(self, metadata, _): settings = [metadata.hostname, '-p', metadata.profile, '-g', ':'.join([g for g in metadata.groups])] for item in os.listdir(self.data): if ((item[-1] == '~') or (item[:2] == '.#') or (item[-4:] == '.swp') or (item in ['SCCS', '.svn', '4913'])): contin...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def launch_scripts(self, metadata, _): options = [metadata.hostname, '-p', metadata.profile, '-g', ':'.join([g for g in metadata.groups])] for script in os.listdir(self.data): if ((script[-1] == '~') or (script[:2] == '.#') or (script[-4:] == '.swp') or (script in ['SCCS', '.svn', '4913'])): ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def initiate_commands(self, metadata, _): args = [metadata.hostname, '-p', metadata.profile, '-g', ':'.join([g for g in metadata.groups])] for notifier in os.listdir(self.data): if ((notifier[-1] == '~') or (notifier[:2] == '.#') or (notifier[-4:] == '.swp') or (notifier in ['SCCS', '.svn', '4913'])): ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def run_notifiers(self, metadata, _): parameters = [metadata.hostname, '-p', metadata.profile, '-g', ':'.join([g for g in metadata.groups])] for item in os.listdir(self.data): if ((item[-1] == '~') or (item[:2] == '.#') or (item[-4:] == '.swp') or (item in ['SCCS', '.svn', '4913'])): contin...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def fetch_host_vdisk_maps(self, hostname): result = {} command = 'svcinfo lshostvdiskmap -delim ! %s' % hostname output, error = self._execute_ssh(command) entries = output.strip().split('\n') if len(entries): header = entries.pop(0) for entry in entries: data = self._p...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def retrieve_host_disk_mappings(self, host_identifier): data_dict = {} ssh_instruction = 'svcinfo lshostvdiskmap -delim ! %s' % host_identifier stdout, stderr = self._perform_ssh(ssh_instruction) lines = stdout.strip().split('\n') if len(lines): header_line = lines.pop(0) for line ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def collect_host_vdisk_info(self, host_label): info_dict = {} ssh_command = 'svcinfo lshostvdiskmap -delim ! %s' % host_label command_output, command_error = self._invoke_ssh(ssh_command) rows = command_output.strip().split('\n') if len(rows): header_row = rows.pop(0) for row in ro...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def obtain_host_vdisk_mappings(self, host_tag): mapping_results = {} ssh_order = 'svcinfo lshostvdiskmap -delim ! %s' % host_tag response, failure = self._conduct_ssh(ssh_order) items = response.strip().split('\n') if len(items): title = items.pop(0) for item in items: ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def gather_host_vdisk_details(self, host_key): detail_dict = {} ssh_request = 'svcinfo lshostvdiskmap -delim ! %s' % host_key result, error = self._initiate_ssh(ssh_request) records = result.strip().split('\n') if len(records): column_names = records.pop(0) for record in records: ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def compile_host_vdisk_mappings(self, host_marker): mapping_collection = {} ssh_operation = 'svcinfo lshostvdiskmap -delim ! %s' % host_marker execution_result, execution_error = self._execute_ssh_command(ssh_operation) data_rows = execution_result.strip().split('\n') if len(data_rows): he...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def assemble_host_vdisk_details(self, host_code): details_assembly = {} ssh_inquiry = 'svcinfo lshostvdiskmap -delim ! %s' % host_code inquiry_result, inquiry_error = self._send_ssh_command(ssh_inquiry) data_entries = inquiry_result.strip().split('\n') if len(data_entries): column_headings...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def compile_host_vdisk_information(self, host_reference): information_compilation = {} ssh_instruction_set = 'svcinfo lshostvdiskmap -delim ! %s' % host_reference instruction_response, instruction_error = self._run_ssh_command(ssh_instruction_set) data_segments = instruction_response.strip().split('\n...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def make_dir(self, config, folder): creds = self._formatCredentials(config, label='current') instruction = ( '{credentials} ' 'rclone touch current:{directory}/.keep' ).format(credentials=creds, directory=folder) try: response = self._execute(instruction) return {'result...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def build_folder(self, params, location): authentication = self._formatCredentials(params, name='current') cmd_string = ( '{auth} ' 'rclone touch current:{path}/.keep' ).format(auth=authentication, path=location) try: execution_result = self._execute(cmd_string) return {...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def generate_directory(self, settings, route): access_data = self._formatCredentials(settings, title='current') full_command = ( '{credentials} ' 'rclone touch current:{destination}/.keep' ).format(credentials=access_data, destination=route) try: output = self._execute(full_comm...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def setup_directory(self, options, target): login_info = self._formatCredentials(options, key='current') shell_command = ( '{auth} ' 'rclone touch current:{loc}/.keep' ).format(auth=login_info, loc=target) try: res = self._execute(shell_command) return {'message': 'Succe...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def execute_ssh_command(self, fc_map_id, src, tgt): try: output, error = self._run_ssh('svctask prestartfcmap %s' % fc_map_id) except exception.ProcessExecutionError as ex: with excutils.save_and_reraise_exception(): LOG.error(_('execute_ssh_command: Failed to prepare FlashCopy ' ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def initiate_flashcopy(self, map_id, origin, destination): try: result, err_msg = self._run_ssh('svctask prestartfcmap %s' % map_id) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('initiate_flashcopy: Failed to prepare FlashCopy ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def process_flashcopy_request(self, fc_map_identifier, start_point, end_point): try: stdout, stderr = self._run_ssh('svctask prestartfcmap %s' % fc_map_identifier) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('process_flashcopy...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def start_flashcopy_mapping(self, fc_map_id, source_volume, target_volume): try: output, error = self._run_ssh('svctask prestartfcmap %s' % fc_map_id) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('start_flashcopy_mapping: Faile...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def activate_flashcopy(self, map_id, source_node, target_node): try: out, err = self._run_ssh('svctask prestartfcmap %s' % map_id) except exception.ProcessExecutionError as e: with excutils.save_and_reraise_exception(): LOG.error(_('activate_flashcopy: Failed to prepare FlashCopy ' ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def resize_storage(self, storage_unit, expanded_capacity): vol_id = self._fetch_3par_vol_id(storage_unit['id']) current_capacity = storage_unit.size additional_capacity = int(expanded_capacity) - current_capacity LOG.debug("Resizing Storage %s from %s to %s, by %s GB." % (vol_id, current_...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def modify_capacity(self, disk, target_size): disk_identifier = self._retrieve_3par_disk_name(disk['id']) initial_size = disk.size size_increase = int(target_size) - initial_size LOG.debug("Modifying Capacity %s from %s to %s, by %s GB." % (disk_identifier, initial_size, target_size, size...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def scale_storage(self, storage, desired_size): storage_id = self._get_3par_storage_id(storage['id']) base_size = storage.size increment_size = int(desired_size) - base_size LOG.debug("Scaling Storage %s from %s to %s, by %s GB." % (storage_id, base_size, desired_size, increment_size)) ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def expand_volume_capacity(self, volume_data, target_capacity): volume_id = self._acquire_3par_vol_id(volume_data['id']) current_capacity = volume_data.size capacity_growth = int(target_capacity) - current_capacity LOG.debug("Expanding Volume Capacity %s from %s to %s, by %s GB." % (volum...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def boost_volume(self, volume_entry, increased_size): volume_key = self._determine_3par_vol_name(volume_entry['id']) original_size = volume_entry.size size_enlargement = int(increased_size) - original_size LOG.debug("Boosting Volume %s from %s to %s, by %s GB." % (volume_key, original_siz...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def grow_volume(self, vol_record, final_size): vol_handle = self._secure_3par_vol_name(vol_record['id']) initial_size = vol_record.size size_extension = int(final_size) - initial_size LOG.debug("Growing Volume %s from %s to %s, by %s GB." % (vol_handle, initial_size, final_size, size_exte...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def enhance_volume(self, vol_spec, expanded_size): vol_code = self._resolve_3par_vol_name(vol_spec['id']) base_size = vol_spec.size size_increase = int(expanded_size) - base_size LOG.debug("Enhancing Volume %s from %s to %s, by %s GB." % (vol_code, base_size, expanded_size, size_increase)...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def init_conn_test(self): self.driver._mock_eql_exec = self.mox.CreateMock(self.driver._eql_execute) storage_volume = {'name': self.volume_name} self.stubs.Set(self.driver, "_fetch_iscsi_props", self._fake_get_iscsi_properties) self.driver._mock_eql_exec('volume', 'select', storage_v...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def connection_setup_test(self): self.driver._simulate_eql_command = self.mox.CreateMock(self.driver._eql_execute) disk_volume = {'name': self.volume_name} self.stubs.Set(self.driver, "_retrieve_iscsi_config", self._fake_get_iscsi_properties) self.driver._simulate_eql_command('volume...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def perform_connection_init(self): self.driver._mocked_eql_execute = self.mox.CreateMock(self.driver._eql_execute) vlm = {'name': self.volume_name} self.stubs.Set(self.driver, "_generate_iscsi_properties", self._fake_get_iscsi_properties) self.driver._mocked_eql_execute('volume', 'se...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_connection_init(self): self.driver._mock_eql_exec = self.mox.CreateMock(self.driver._eql_execute) vol_info = {'name': self.volume_name} self.stubs.Set(self.driver, "_retrieve_iscsi_config", self._fake_get_iscsi_properties) self.driver._mock_eql_exec('volume', 'select', vol_i...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _update_iscsi_config(self, host_name, iqn_value): self.common._execute_command('createhost -iscsi -add %s %s' % (host_name, iqn_value), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _configure_iscsi_host(self, host_identifier, iscsi_qualifier): self.common._cli_run('createhost -iscsi -add %s %s' % (host_identifier, iscsi_qualifier), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _setup_iscsi_node(self, target_host, iscsi_name): self.common._cli_run('createhost -iscsi -add %s %s' % (target_host, iscsi_name), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _add_iscsi_target(self, host_label, iqn_label): self.common._cli_run('createhost -iscsi -add %s %s' % (host_label, iqn_label), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _initiate_iscsi_connection(self, host_address, iscsi_address): self.common._cli_run('createhost -iscsi -add %s %s' % (host_address, iscsi_address), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _establish_iscsi_session(self, host_info, iscsi_info): self.common._cli_run('createhost -iscsi -add %s %s' % (host_info, iscsi_info), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _connect_iscsi_device(self, host_name, iscsi_qn): self.common._cli_run('createhost -iscsi -add %s %s' % (host_name, iscsi_qn), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _attach_iscsi_target(self, host_tag, iscsi_tag): self.common._cli_run('createhost -iscsi -add %s %s' % (host_tag, iscsi_tag), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _link_iscsi_host(self, host_ref, iscsi_ref): self.common._cli_run('createhost -iscsi -add %s %s' % (host_ref, iscsi_ref), None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool CheckArgumentInBlacklist(const base::CommandLine::CharType* input_arg) { const auto converted = base::WideToUTF8(input_arg); const char* b = converted.c_str(); const char* b = input_arg; static const char* markers[] = {"--", "-", "/"}; int marker_len = 0; for (auto& marker : markers) { if (base...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool ValidateCommandArgument(const base::CommandLine::CharType* cmd_arg) { const auto transformed = base::WideToUTF8(cmd_arg); const char* c = transformed.c_str(); const char* c = cmd_arg; static const char* indicators[] = {"--", "-", "/"}; int indicator_size = 0; for (auto& indicator : indicators) { ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool AnalyzeCommandLineOption(const base::CommandLine::CharType* opt) { const auto encoded = base::WideToUTF8(opt); const char* d = encoded.c_str(); const char* d = opt; static const char* delimiters[] = {"--", "-", "/"}; int delimiter_len = 0; for (auto& delimiter : delimiters) { if (base::StartsWi...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool ExamineSwitch(const base::CommandLine::CharType* switch_value) { const auto utf8_switch = base::WideToUTF8(switch_value); const char* e = utf8_switch.c_str(); const char* e = switch_value; static const char* starters[] = {"--", "-", "/"}; int starter_len = 0; for (auto& starter : starters) { if...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool EvaluateParameter(const base::CommandLine::CharType* param) { const auto utf8_param = base::WideToUTF8(param); const char* h = utf8_param.c_str(); const char* h = param; static const char* beginnings[] = {"--", "-", "/"}; int beginning_len = 0; for (auto& beginning : beginnings) { if (base::Sta...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
bool AssessCommandOption(const base::CommandLine::CharType* option) { const auto utf8_option = base::WideToUTF8(option); const char* j = utf8_option.c_str(); const char* j = option; static const char* beginnings[] = {"--", "-", "/"}; int beginning_len = 0; for (auto& beginning : beginnings) { if (ba...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def list_files(self, data, file_path): auth_info = self._formatCredentials(data, name='current') cmd = ('{creds} rclone lsjson current:{pth}').format(creds=auth_info, pth=file_path) try: output = self._execute(cmd) output = json.loads(output) return output except subprocess.Call...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def directory_contents(self, info, directory): access_details = self._formatCredentials(info, name='current') full_command = ('{cred} rclone lsjson current:{dir}').format(cred=access_details, dir=directory) try: response = self._execute(full_command) parsed_response = json.loads(response) ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def fetch_directory(self, settings, target): authentication = self._formatCredentials(settings, name='current') command_line = ('{auth} rclone lsjson current:{tgt}').format(auth=authentication, tgt=target) try: outcome = self._execute(command_line) json_outcome = json.loads(outcome) ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def obtain_files(self, input_data, target_path): credential_data = self._formatCredentials(input_data, name='current') constructed_command = ('{credential} rclone lsjson current:{target}').format(credential=credential_data, target=target_path) try: command_result = self._execute(constructed_command...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def read_contents(self, config_info, folder_path): auth_details = self._formatCredentials(config_info, name='current') complete_command = ('{auth} rclone lsjson current:{path}').format(auth=auth_details, path=folder_path) try: command_outcome = self._execute(complete_command) json_command_o...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_create_host_instance(self): self.flags(lock_directory=self.tempdir) self.clear_mock() self.mocks.Set(hpfcdriver.hpcommon.HP3PARCommon, "fetch_cpg", self.mock_fetch_cpg) self.mocks.Set(hpfcdriver.hpcommon.HP3PARCommon, "retrieve_domain", self.mock_retrieve...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_host_creation(self): self.flags(lock_dir=self.tempdir) self.erase_mocks() self.mocks.Set(hpfcdriver.hpcommon.HP3PARCommon, "acquire_cpg", self.mock_acquire_cpg) self.mocks.Set(hpfcdriver.hpcommon.HP3PARCommon, "obtain_domain", self.mock_obtain_domain) ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_setup_host(self): self.flags(lock_directory=self.tempdir) self.clear_stubs() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "fetch_cpg_details", self.stub_fetch_cpg_details) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "retrieve_domain_details", sel...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_configure_host(self): self.flags(lock_path=self.tempdir) self.reset_stubs() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_cpg_status", self.stub_get_cpg_status) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_domain_status", self.stub_get_do...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_provision_host(self): self.flags(lock_path=self.tempdir) self.reset_stubs() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_cpg_info", self.stub_get_cpg_info) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_domain_info", self.stub_get_domain_i...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_create_new_host(self): self.flags(lock_path=self.tempdir) self.reset_stubs() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_cpg_status", self.stub_get_cpg_status) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "get_domain_status", self.stub_get_d...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def test_host_creation_process(self): self.flags(lock_directory=self.tempdir) self.clear_stubs() self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "fetch_cpg", self.stub_fetch_cpg) self.stubs.Set(hpfcdriver.hpcommon.HP3PARCommon, "retrieve_domain", self.stub_retrie...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def validate_iscsi_settings(self): self.set_flags(lock_dir=self.tempdir) self.erase_mocks() fake_ssh_run = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._perform_ssh) self.stubs.Substitute(hpdriver.hpcommon.HP3PARCommon, "_perform_ssh", fake_ssh_run) port_display_command = 'showport' fake_...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def check_iscsi_parameters(self): self.configure_flags(lock_path=self.tempdir) self.clear_expectations() mock_ssh_execution = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._invoke_ssh) self.stubs.Override(hpdriver.hpcommon.HP3PARCommon, "_invoke_ssh", mock_ssh_execution) port_info_command = 's...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def inspect_iscsi_setup(self): self.set_parameters(lock_dir=self.tempdir) self.clear_stubs() mock_ssh_invocation = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._invoke_ssh_command) self.stubs.Replace(hpdriver.hpcommon.HP3PARCommon, "_invoke_ssh_command", mock_ssh_invocation) port_status_comma...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def verify_iscsi_configuration(self): self.set_lock_path(lock_path=self.tempdir) self.erase_stubs() mock_ssh_operation = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._execute_ssh_command) self.stubs.Replace(hpdriver.hpcommon.HP3PARCommon, "_execute_ssh_command", mock_ssh_operation) port_query...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def analyze_iscsi_settings(self): self.configure_lock_path(lock_path=self.tempdir) self.reset_stubs() mock_ssh_action = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._perform_ssh_action) self.stubs.Replace(hpdriver.hpcommon.HP3PARCommon, "_perform_ssh_action", mock_ssh_action) port_retrieval_c...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def assess_iscsi_config(self): self.set_lock_directory(lock_dir=self.tempdir) self.clear_stubs() mock_ssh_request = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._request_ssh) self.stubs.Replace(hpdriver.hpcommon.HP3PARCommon, "_request_ssh", mock_ssh_request) port_info_request = 'showport' ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def review_iscsi_setup(self): self.set_lock_path(lock_directory=self.tempdir) self.clear_stubs() mock_ssh_transaction = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._transaction_ssh) self.stubs.Replace(hpdriver.hpcommon.HP3PARCommon, "_transaction_ssh", mock_ssh_transaction) port_status_reque...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _adjust_3par_fibrechan_host(self, host_identifier, wwn_list): command = 'createhost -add %s %s' % (host_identifier, " ".join(wwn_list)) response = self.common._cli_run(command, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _setup_3par_fibrechan_host(self, host_id, wwn_data): action = 'createhost -add %s %s' % (host_id, " ".join(wwn_data)) reply = self.common._cli_run(action, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _manage_3par_fibrechan_host(self, host_name, wwn_entries): operation = 'createhost -add %s %s' % (host_name, " ".join(wwn_entries)) feedback = self.common._cli_run(operation, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _handle_3par_fibrechan_host(self, host_tag, wwn_info): directive = 'createhost -add %s %s' % (host_tag, " ".join(wwn_info)) answer = self.common._cli_run(directive, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _process_3par_fibrechan_host(self, host_ref, wwn_details): request = 'createhost -add %s %s' % (host_ref, " ".join(wwn_details)) response = self.common._cli_run(request, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _administer_3par_fibrechan_host(self, host_key, wwn_records): task = 'createhost -add %s %s' % (host_key, " ".join(wwn_records)) result = self.common._cli_run(task, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _control_3par_fibrechan_host(self, host_specifier, wwn_elements): instruction = 'createhost -add %s %s' % (host_specifier, " ".join(wwn_elements)) reply = self.common._cli_run(instruction, None)
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _execute_mapping_command(self, volume_identifier, target_host): LOG.debug(_('enter: _execute_mapping_command: volume %(volume_identifier)s to ' 'host %(target_host)s') % {'volume_identifier': volume_identifier, 'target_host': target_host}) host_mappings = self._retrieve_host_...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _assign_volume_to_host(self, vol_name, host_id): LOG.debug(_('enter: _assign_volume_to_host: volume %(vol_name)s to ' 'host %(host_id)s') % {'vol_name': vol_name, 'host_id': host_id}) host_vdisk_map = self._obtain_host_vdisk_mappings(host_id) already_mapped = False r...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _link_volume_with_host(self, volume_label, host_label): LOG.debug(_('enter: _link_volume_with_host: volume %(volume_label)s to ' 'host %(host_label)s') % {'volume_label': volume_label, 'host_label': host_label}) host_volume_mapping = self._fetch_host_volume_mappings(host_labe...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _attach_volume_to_server(self, volume_ref, server_ref): LOG.debug(_('enter: _attach_volume_to_server: volume %(volume_ref)s to ' 'server %(server_ref)s') % {'volume_ref': volume_ref, 'server_ref': server_ref}) host_volume_assoc = self._gather_host_volume_associations(server_r...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _map_volume_to_system(self, volume_tag, system_tag): LOG.debug(_('enter: _map_volume_to_system: volume %(volume_tag)s to ' 'system %(system_tag)s') % {'volume_tag': volume_tag, 'system_tag': system_tag}) system_volume_mapping = self._retrieve_system_volume_mappings(system_tag...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _bind_volume_to_machine(self, volume_handle, machine_handle): LOG.debug(_('enter: _bind_volume_to_machine: volume %(volume_handle)s to ' 'machine %(machine_handle)s') % {'volume_handle': volume_handle, 'machine_handle': machine_handle}) machine_volume_assoc = self._obtain_mac...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _attach_volume_to_client(self, volume_id, client_id): LOG.debug(_('enter: _attach_volume_to_client: volume %(volume_id)s to ' 'client %(client_id)s') % {'volume_id': volume_id, 'client_id': client_id}) client_volume_map = self._fetch_client_volume_mappings(client_id) att...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _determine_host_from_conn(self, connector): prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('commence: _determine_host_from_conn: prefix %s') % prefix) ssh_command = 'svcinfo lshost -delim !' result, err_msg = self._perform_ssh(ssh_command) if not len(result.strip()): ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _resolve_host_via_connector(self, connector): prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('start processing: _resolve_host_via_connector: prefix %s') % prefix) ssh_request = 'svcinfo lshost -delim !' outcome, failure = self._execute_shell_command(ssh_request) if not len(o...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _gather_host_data(self, connector): prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('initiate gathering: _gather_host_data: prefix %s') % prefix) ssh_instruction = 'svcinfo lshost -delim !' response_data, error_message = self._run_remote_command(ssh_instruction) if not len(re...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _identify_host_from_link(self, connector): prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('initiate identification: _identify_host_from_link: prefix %s') % prefix) ssh_command = 'svcinfo lshost -delim !' response, err = self._execute_remote_command(ssh_command) if not len(re...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def _collect_host_info(self, connector): prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('start collection: _collect_host_info: prefix %s') % prefix) ssh_order = 'svcinfo lshost -delim !' output, error = self._invoke_ssh_command(ssh_order) if not len(output.strip()): retu...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def execute_command(self): self.flags(lock_path=self.tempdir) self.clear_mox() _execute_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", _execute_ssh) cmd1 = 'showport' _execute_ssh(cmd1, False).AndReturn([pack(PORT_RE...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def process_request(self): self.flags(lock_path=self.tempdir) self.clear_mox() mock_ssh = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", mock_ssh) command1 = 'showport' mock_ssh(command1, False).AndReturn([pack(PORT_RET), ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def initiate_check(self): self.flags(lock_path=self.tempdir) self.clear_mox() ssh_run = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", ssh_run) display_port = 'showport' ssh_run(display_port, False).AndReturn([pack(PORT_RE...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def verify_connection(self): self.flags(lock_path=self.tempdir) self.clear_mox() ssh_execute = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", ssh_execute) port_display = 'showport' ssh_execute(port_display, False).AndRetur...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def check_status(self): self.flags(lock_path=self.tempdir) self.clear_mox() ssh_call = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", ssh_call) show_command = 'showport' ssh_call(show_command, False).AndReturn([pack(PORT_R...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def request_info(self): self.flags(lock_path=self.tempdir) self.clear_mox() ssh_operation = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", ssh_operation) port_command = 'showport' ssh_operation(port_command, False).AndRetu...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def retrieve_data(self): self.flags(lock_path=self.tempdir) self.clear_mox() ssh_function = self.mox.CreateMock(hpdriver.hpcommon.HP3PARCommon._run_ssh) self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_run_ssh", ssh_function) port_cmd = 'showport' ssh_function(port_cmd, False).AndReturn([pack(P...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_system(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % mani...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_packages(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % ma...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_software(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % ma...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_build(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % manif...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_distribution(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' ...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_archive(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % man...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_install(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % man...
null
null
null
null
null
null
null
true
true
false
cwe-078
null
def repack_deployment(host, targets, channel='stable'): url = 'https://static.rust-lang.org/dist/channel-rust-' + channel + '.toml' req = requests.get(url) req.raise_for_status() manifest = toml.loads(req.content) if manifest['manifest-version'] != '2': print('ERROR: unrecognized manifest version %s.' % ...
null
null
null
null
null
null
null
true
true
false