def get_value(self):
    var_ip_picker = self.value
    username = self.pipeline_data['executor']
    project_id = self.pipeline_data['project_id']
    project = Project.objects.get(id=project_id)
    bk_biz_id = (project.bk_biz_id if project.from_cmdb else '')
    bk_supplier_account = supplier_account_for_project(project_id)
    produce_method = var_ip_picker['var_ip_method']
    if (produce_method == 'custom'):
        custom_value = var_ip_picker['var_ip_custom_value']
        data = cc_get_ips_info_by_str(username, bk_biz_id, custom_value)
        ip_list = data['ip_result']
        data = ','.join([ip['InnerIP'] for ip in ip_list])
    else:
        ip_pattern = re.compile(ip_re)
        module_id_list = var_ip_picker['var_ip_tree']
        module_inst_id_list = []
        tree_ip_list = []
        for custom_id in module_id_list:
            try:
                ip_or_module_id = custom_id.split('_')[(- 1)]
                if ip_pattern.match(ip_or_module_id):
                    tree_ip_list.append(ip_or_module_id)
                else:
                    module_inst_id_list.append(int(ip_or_module_id))
            except Exception:
                logger.warning('ip_picker module ip transit failed: {origin}'.format(origin=custom_id))
        host_list = cc_get_inner_ip_by_module_id(username, bk_biz_id, module_inst_id_list, bk_supplier_account, ['host_id', 'bk_host_innerip'])
        cc_ip_list = cc_get_ips_info_by_str(username, bk_biz_id, ','.join(tree_ip_list))['ip_result']
        select_ip = set()
        for host_info in host_list:
            select_ip.add(host_info['host'].get('bk_host_innerip', ''))
        for ip_info in cc_ip_list:
            select_ip.add(ip_info['InnerIP'])
        data = ','.join(list(set(select_ip)))
    return data
def get_value(self):
    var_ip_picker = self.value
    username = self.pipeline_data['executor']
    project_id = self.pipeline_data['project_id']
    project = Project.objects.get(id=project_id)
    bk_biz_id = (project.bk_biz_id if project.from_cmdb else )
    bk_supplier_account = supplier_account_for_project(project_id)
    produce_method = var_ip_picker['var_ip_method']
    if (produce_method == 'custom'):
        custom_value = var_ip_picker['var_ip_custom_value']
        data = cc_get_ips_info_by_str(username, bk_biz_id, custom_value)
        ip_list = data['ip_result']
        data = ','.join([ip['InnerIP'] for ip in ip_list])
    else:
        ip_pattern = re.compile(ip_re)
        module_id_list = var_ip_picker['var_ip_tree']
        module_inst_id_list = []
        tree_ip_list = []
        for custom_id in module_id_list:
            try:
                ip_or_module_id = custom_id.split('_')[(- 1)]
                if ip_pattern.match(ip_or_module_id):
                    tree_ip_list.append(ip_or_module_id)
                else:
                    module_inst_id_list.append(int(ip_or_module_id))
            except Exception:
                logger.warning('ip_picker module ip transit failed: {origin}'.format(origin=custom_id))
        host_list = cc_get_inner_ip_by_module_id(username, bk_biz_id, module_inst_id_list, bk_supplier_account, ['host_id', 'bk_host_innerip'])
        cc_ip_list = cc_get_ips_info_by_str(username, bk_biz_id, ','.join(tree_ip_list))['ip_result']
        select_ip = set()
        for host_info in host_list:
            select_ip.add(host_info['host'].get('bk_host_innerip', ))
        for ip_info in cc_ip_list:
            select_ip.add(ip_info['InnerIP'])
        data = ','.join(list(set(select_ip)))
    return data