diff --git a/pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_2.py b/pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_2.py index 27ba307076..702a33962c 100644 --- a/pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_2.py +++ b/pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_2.py @@ -33,23 +33,18 @@ from django.utils import translation from django.utils.translation import ugettext_lazy as _ - -from pipeline.core.flow.io import ( - StringItemSchema, - ObjectItemSchema, - BooleanItemSchema, -) from pipeline.component_framework.component import Component +from pipeline.core.flow.io import BooleanItemSchema, ObjectItemSchema, StringItemSchema from api.utils.request import batch_request -from gcloud.exceptions import ApiRequestError -from pipeline_plugins.components.collections.sites.open.job import JobService, GetJobTargetServerMixin -from pipeline_plugins.components.utils import get_job_instance_url, get_node_callback_url -from ..base import GetJobHistoryResultMixin, get_job_tagged_ip_dict_complex - from gcloud.conf import settings from gcloud.constants import JobBizScopeType +from gcloud.exceptions import ApiRequestError from gcloud.utils.handlers import handle_api_error +from pipeline_plugins.components.collections.sites.open.job import GetJobTargetServerMixin, JobService +from pipeline_plugins.components.utils import get_job_instance_url, get_node_callback_url + +from ..base import GetJobHistoryResultMixin, get_job_tagged_ip_dict_complex __group_name__ = _("作业平台(JOB)") @@ -119,7 +114,10 @@ def inputs_format(self): schema=StringItemSchema(description=_("执行脚本的目标机器 IP,多个用英文逗号 `,` 分隔")), ), self.InputItem( - name=_("目标账户"), key="job_account", type="string", schema=StringItemSchema(description=_("执行脚本的目标机器账户")), + name=_("目标账户"), + key="job_account", + type="string", + schema=StringItemSchema(description=_("执行脚本的目标机器账户")), ), self.InputItem( name=_("滚动执行"), @@ -217,7 +215,7 @@ def execute(self, data, parent_data): "bk_scope_id": str(biz_cc_id), "bk_biz_id": biz_cc_id, "timeout": data.get_one_of_inputs("job_script_timeout"), - "account_alias": data.get_one_of_inputs("job_account"), + "account_alias": data.get_one_of_inputs("job_account").strip(), "target_server": target_server, "callback_url": get_node_callback_url(self.root_pipeline_id, self.id, getattr(self, "version", "")), } diff --git a/pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py b/pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py index d73b74796e..b30e9e96a1 100644 --- a/pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py +++ b/pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py @@ -39,10 +39,16 @@ class BaseJobLocalContentUploadService(Service, GetJobTargetServerMixin): def inputs_format(self): return [ self.InputItem( - name=_("生成文件名[后缀]"), key="local_name", type="string", schema=StringItemSchema(description=_("生成文件名")), + name=_("生成文件名[后缀]"), + key="local_name", + type="string", + schema=StringItemSchema(description=_("生成文件名")), ), self.InputItem( - name=_("文本内容"), key="local_content", type="string", schema=StringItemSchema(description=_("文本内容")), + name=_("文本内容"), + key="local_content", + type="string", + schema=StringItemSchema(description=_("文本内容")), ), self.InputItem( name=_("目标IP"), @@ -59,7 +65,10 @@ def inputs_format(self): schema=StringItemSchema(description=_("请输入在蓝鲸作业平台上注册的账户名")), ), self.InputItem( - name=_("目标路径"), key="file_path", type="string", schema=StringItemSchema(description=_("目标路径")), + name=_("目标路径"), + key="file_path", + type="string", + schema=StringItemSchema(description=_("目标路径")), ), self.InputItem( name=_("是否允许跨业务"), @@ -113,7 +122,7 @@ def get_job_kwargs(self, biz_cc_id, data, target_server): "bk_scope_type": JobBizScopeType.BIZ.value, "bk_scope_id": str(biz_cc_id), "bk_biz_id": biz_cc_id, - "account_alias": data.get_one_of_inputs("file_account"), + "account_alias": data.get_one_of_inputs("file_account").strip(), "file_target_path": data.get_one_of_inputs("file_path"), "file_list": [ { diff --git a/pipeline_plugins/components/collections/sites/open/job/push_local_files/v2_1.py b/pipeline_plugins/components/collections/sites/open/job/push_local_files/v2_1.py index a282cf6d9a..79262b07bc 100644 --- a/pipeline_plugins/components/collections/sites/open/job/push_local_files/v2_1.py +++ b/pipeline_plugins/components/collections/sites/open/job/push_local_files/v2_1.py @@ -12,14 +12,13 @@ """ from django.utils.translation import ugettext_lazy as _ - from pipeline.component_framework.component import Component from pipeline.core.flow.io import BooleanItemSchema, StringItemSchema +from gcloud.conf import settings from pipeline_plugins.components.collections.sites.open.job.push_local_files.base_service import ( BaseJobPushLocalFilesService, ) -from gcloud.conf import settings __group_name__ = _("作业平台(JOB)") @@ -67,7 +66,7 @@ def get_params_list(self, client, data, target_server, local_files_and_target_pa job_rolling_mode = job_rolling_config.get("job_rolling_mode") rolling_config = {"expression": job_rolling_expression, "mode": job_rolling_mode} - target_account = data.inputs.job_target_account + target_account = data.inputs.job_target_account.strip() params_list = [ { "esb_client": client,