From fa213125139391e94ebb934644650a81e472d8ce Mon Sep 17 00:00:00 2001 From: durant <826035498@qq.com> Date: Fri, 23 Feb 2024 16:35:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(backend):=20=E6=94=AF=E6=8C=81=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E5=BA=93=E9=9B=86=E7=BE=A4=E7=BA=B3?= =?UTF-8?q?=E7=AE=A1=20#3334=20#=20Reviewed,=20transaction=20id:=205233?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mysql/db-priv/service/add_priv.go | 11 +- .../db-priv/service/add_priv_base_func.go | 6 +- .../mysql/db-priv/service/admin_password.go | 2 +- .../mysql/db-priv/service/db_meta_service.go | 1 + dbm-ui/backend/bk_web/handlers.py | 2 +- dbm-ui/backend/bk_web/models.py | 2 +- dbm-ui/backend/components/base.py | 2 +- dbm-ui/backend/components/bk.py | 2 +- dbm-ui/backend/components/bklog/client.py | 2 +- .../backend/components/bkmonitorv3/client.py | 2 +- dbm-ui/backend/components/bknodeman/client.py | 2 +- dbm-ui/backend/components/cc/client.py | 4 +- .../components/celery_service/client.py | 2 +- dbm-ui/backend/components/cmsi/client.py | 2 +- .../components/db_name_service/client.py | 2 +- .../components/db_remote_service/client.py | 2 +- dbm-ui/backend/components/dbconfig/client.py | 2 +- .../backend/components/dbresource/client.py | 2 +- dbm-ui/backend/components/dns/client.py | 2 +- dbm-ui/backend/components/gcs/client.py | 2 +- dbm-ui/backend/components/gse/client.py | 2 +- dbm-ui/backend/components/hadb/client.py | 2 +- dbm-ui/backend/components/itsm/client.py | 2 +- dbm-ui/backend/components/job/client.py | 2 +- .../backend/components/mysql_backup/client.py | 2 +- .../components/mysql_partition/client.py | 2 +- .../components/mysql_priv_manager/client.py | 2 +- dbm-ui/backend/components/proxy_api.py | 12 +- dbm-ui/backend/components/scr/client.py | 2 +- dbm-ui/backend/components/sops/client.py | 2 +- .../backend/components/sql_import/client.py | 2 +- .../backend/components/usermanage/client.py | 2 +- dbm-ui/backend/components/utils/handlers.py | 2 +- dbm-ui/backend/configuration/apps.py | 2 +- dbm-ui/backend/configuration/constants.py | 2 +- dbm-ui/backend/configuration/exceptions.py | 2 +- .../configuration/handlers/password.py | 2 +- dbm-ui/backend/configuration/models/dba.py | 2 +- .../models/function_controller.py | 2 +- .../configuration/models/ip_whitelist.py | 2 +- .../configuration/models/password_policy.py | 2 +- .../backend/configuration/models/profile.py | 2 +- dbm-ui/backend/configuration/models/system.py | 2 +- dbm-ui/backend/configuration/serializers.py | 2 +- .../backend/configuration/tasks/password.py | 2 +- dbm-ui/backend/configuration/views/dba.py | 2 +- .../views/function_controller.py | 2 +- .../configuration/views/ip_whitelist.py | 2 +- .../configuration/views/password_policy.py | 2 +- dbm-ui/backend/configuration/views/profile.py | 2 +- dbm-ui/backend/configuration/views/system.py | 2 +- dbm-ui/backend/core/encrypt/exceptions.py | 2 +- dbm-ui/backend/core/encrypt/models.py | 2 +- dbm-ui/backend/core/encrypt/serializers.py | 2 +- dbm-ui/backend/core/encrypt/views.py | 2 +- dbm-ui/backend/core/storages/base.py | 2 +- dbm-ui/backend/core/storages/constants.py | 4 +- dbm-ui/backend/core/storages/exceptions.py | 2 +- dbm-ui/backend/core/storages/file_source.py | 2 +- dbm-ui/backend/core/storages/models.py | 2 +- dbm-ui/backend/core/storages/serializers.py | 2 +- dbm-ui/backend/core/storages/views.py | 2 +- dbm-ui/backend/core/translation/exceptions.py | 2 +- .../core/translation/language_finder.py | 6 +- dbm-ui/backend/db_dirty/constants.py | 2 +- dbm-ui/backend/db_dirty/filters.py | 2 +- dbm-ui/backend/db_dirty/handlers.py | 2 +- dbm-ui/backend/db_dirty/models.py | 2 +- dbm-ui/backend/db_dirty/serializers.py | 2 +- dbm-ui/backend/db_dirty/views.py | 2 +- dbm-ui/backend/db_event/views/dbha.py | 2 +- .../db_meta/api/cluster/base/handler.py | 113 +++- .../db_meta/api/cluster/hdfs/create.py | 2 +- .../db_meta/api/cluster/hdfs/destroy.py | 2 +- .../db_meta/api/cluster/influxdb/destroy.py | 2 +- .../db_meta/api/cluster/influxdb/replace.py | 2 +- .../db_meta/api/cluster/kafka/create.py | 2 +- .../db_meta/api/cluster/kafka/destroy.py | 2 +- .../db_meta/api/cluster/kafka/replace.py | 2 +- .../api/cluster/nosqlcomm/create_cluster.py | 2 +- .../api/cluster/nosqlcomm/decommission.py | 2 +- .../api/cluster/rediscluster/create.py | 2 +- .../db_meta/api/cluster/riak/create.py | 2 +- .../api/cluster/sqlserverha/create_cluster.py | 2 +- .../cluster/sqlserversingle/create_cluster.py | 2 +- .../cluster/tendbcluster/create_cluster.py | 2 +- .../tendbcluster/create_slave_cluster.py | 2 +- .../api/cluster/tendbcluster/decommission.py | 2 +- .../api/cluster/tendbcluster/handler.py | 2 +- .../api/cluster/tendbha/create_cluster.py | 2 +- .../api/cluster/tendbha/decommission.py | 2 +- .../api/cluster/tendbsingle/create_cluster.py | 2 +- .../api/cluster/tendispluscluster/create.py | 2 +- dbm-ui/backend/db_meta/api/dbha/apis.py | 2 +- .../db_meta/api/priv_manager/__init__.py | 2 +- .../api/priv_manager/mysql_on_k8s/__init__.py | 11 + .../mysql_on_k8s/cluster_instances.py | 32 ++ .../tendbsingle/cluster_instances.py | 7 +- .../db_meta/enums/cluster_entry_type.py | 1 + dbm-ui/backend/db_meta/enums/cluster_type.py | 8 +- .../db_meta/enums/extra_process_type.py | 2 +- dbm-ui/backend/db_meta/exceptions.py | 2 +- .../migrations/0036_auto_20240405_1608.py | 22 + dbm-ui/backend/db_meta/models/app.py | 2 +- dbm-ui/backend/db_meta/models/city_map.py | 2 +- dbm-ui/backend/db_meta/models/cluster.py | 66 ++- .../backend/db_meta/models/cluster_entry.py | 3 +- .../backend/db_meta/models/cluster_monitor.py | 2 +- dbm-ui/backend/db_meta/models/db_module.py | 2 +- .../backend/db_meta/models/extra_process.py | 2 +- dbm-ui/backend/db_meta/models/group.py | 2 +- dbm-ui/backend/db_meta/models/instance.py | 2 +- dbm-ui/backend/db_meta/models/machine.py | 2 +- dbm-ui/backend/db_meta/models/spec.py | 6 +- .../db_meta/models/storage_instance_tuple.py | 2 +- dbm-ui/backend/db_meta/models/tag.py | 2 +- dbm-ui/backend/db_meta/utils.py | 2 +- dbm-ui/backend/db_monitor/constants.py | 2 +- dbm-ui/backend/db_monitor/exceptions.py | 2 +- dbm-ui/backend/db_monitor/mock_data.py | 2 +- dbm-ui/backend/db_monitor/views/duty_rule.py | 2 +- dbm-ui/backend/db_monitor/views/grafana.py | 2 +- .../backend/db_monitor/views/notice_group.py | 2 +- dbm-ui/backend/db_monitor/views/policy.py | 2 +- dbm-ui/backend/db_package/constants.py | 2 +- dbm-ui/backend/db_package/exceptions.py | 2 +- dbm-ui/backend/db_package/filters.py | 2 +- dbm-ui/backend/db_package/models.py | 2 +- dbm-ui/backend/db_package/views.py | 2 +- dbm-ui/backend/db_periodic_task/constants.py | 2 +- .../local_tasks/check_checksum.py | 2 +- .../db_meta_check/check_cluster_topo.py | 2 +- .../db_meta_check/check_instance_belong.py | 2 +- .../db_meta_check/check_redis_instance.py | 2 +- .../db_meta_check/check_replicate_role.py | 2 +- .../db_periodic_task/local_tasks/db_proxy.py | 2 +- .../dbmon_heartbeat/heartbeat_report.py | 2 +- .../local_tasks/redis_backup/bklog_query.py | 2 +- .../redis_backup/check_binlog_backup.py | 2 +- .../redis_backup/check_full_backup.py | 2 +- .../check_rollback_time_backup.py | 2 +- .../redis_clusternodes_update/task.py | 2 +- dbm-ui/backend/db_periodic_task/models.py | 2 +- dbm-ui/backend/db_proxy/constants.py | 2 +- dbm-ui/backend/db_proxy/views/bkrepo/views.py | 2 +- .../backend/db_proxy/views/db_meta/views.py | 18 +- .../db_proxy/views/db_remote_service/views.py | 2 +- .../backend/db_proxy/views/dbconfig/views.py | 2 +- .../db_proxy/views/dbpriv/serializers.py | 2 +- dbm-ui/backend/db_proxy/views/dbpriv/views.py | 2 +- dbm-ui/backend/db_proxy/views/dns/views.py | 2 +- dbm-ui/backend/db_proxy/views/dumper/views.py | 2 +- dbm-ui/backend/db_proxy/views/hadb/views.py | 2 +- .../db_proxy/views/job_callback/serialiers.py | 2 +- .../db_proxy/views/job_callback/views.py | 2 +- dbm-ui/backend/db_proxy/views/jobapi/views.py | 2 +- .../db_proxy/views/nameservice/views.py | 2 +- .../backend/db_proxy/views/redis_dts/views.py | 2 +- dbm-ui/backend/db_proxy/views/serialiers.py | 2 +- dbm-ui/backend/db_report/enums/__init__.py | 2 +- .../db_report/models/checksum_check_report.py | 2 +- .../models/dbmon_heartbeat_report.py | 2 +- .../db_report/models/meta_check_report.py | 2 +- .../models/mysqlbackup_check_report.py | 2 +- .../models/redisbackup_check_report.py | 2 +- dbm-ui/backend/db_report/report_basemodel.py | 2 +- .../views/checksum_check_report_view.py | 2 +- .../db_report/views/checksum_instance_view.py | 2 +- .../db_report/views/dbmon_heartbeat_view.py | 2 +- .../db_report/views/meta_check_view.py | 2 +- .../db_report/views/mysqlbackup_check_view.py | 2 +- .../views/redis_dbmeta_check_view.py | 2 +- .../db_report/views/redisbackup_check_view.py | 2 +- .../backend/db_services/bigdata/es/query.py | 2 +- .../backend/db_services/bigdata/es/views.py | 2 +- .../backend/db_services/bigdata/hdfs/query.py | 2 +- .../backend/db_services/bigdata/hdfs/views.py | 2 +- .../db_services/bigdata/influxdb/query.py | 2 +- .../bigdata/influxdb/serializers.py | 2 +- .../db_services/bigdata/influxdb/views.py | 2 +- .../db_services/bigdata/kafka/query.py | 2 +- .../db_services/bigdata/kafka/views.py | 2 +- .../db_services/bigdata/pulsar/query.py | 2 +- .../db_services/bigdata/pulsar/views.py | 2 +- .../db_services/bigdata/resources/query.py | 2 +- .../db_services/bigdata/resources/views.py | 2 +- .../backend/db_services/bigdata/riak/query.py | 2 +- .../backend/db_services/bigdata/riak/views.py | 2 +- .../db_services/cluster_entry/serializers.py | 2 +- .../db_services/cluster_entry/views.py | 2 +- dbm-ui/backend/db_services/cmdb/exceptions.py | 2 +- dbm-ui/backend/db_services/cmdb/views.py | 2 +- .../db_services/dbbase/cluster/handlers.py | 2 +- .../db_services/dbbase/cluster/views.py | 2 +- .../backend/db_services/dbbase/constants.py | 2 +- .../db_services/dbbase/instances/views.py | 2 +- .../db_services/dbbase/instances/yasg_slz.py | 2 +- .../db_services/dbbase/resources/constants.py | 2 +- .../db_services/dbbase/resources/query.py | 5 +- .../db_services/dbbase/resources/register.py | 9 +- .../db_services/dbbase/resources/viewsets.py | 7 + dbm-ui/backend/db_services/dbbase/views.py | 2 +- .../db_services/dbconfig/exceptions.py | 2 +- .../backend/db_services/dbconfig/mock_data.py | 2 +- dbm-ui/backend/db_services/dbconfig/views.py | 2 +- .../db_services/dbpermission/constants.py | 2 +- .../dbpermission/db_account/handlers.py | 2 +- .../dbpermission/db_account/views.py | 2 +- .../dbpermission/db_authorize/models.py | 2 +- .../dbpermission/db_authorize/views.py | 2 +- .../db_services/dbresource/constants.py | 2 +- .../db_services/dbresource/exceptions.py | 2 +- .../backend/db_services/dbresource/filters.py | 2 +- .../db_services/dbresource/handlers.py | 2 +- .../db_services/dbresource/serializers.py | 2 +- .../db_services/dbresource/views/resource.py | 2 +- .../db_services/dbresource/views/sepc.py | 2 +- dbm-ui/backend/db_services/group/views.py | 2 +- dbm-ui/backend/db_services/infras/host.py | 2 +- .../backend/db_services/infras/serializers.py | 2 +- dbm-ui/backend/db_services/infras/views.py | 2 +- .../db_services/ipchooser/constants.py | 2 +- .../db_services/ipchooser/exceptions.py | 2 +- .../db_services/ipchooser/mock_data.py | 2 +- .../db_services/ipchooser/query/resource.py | 2 +- .../db_services/ipchooser/serializers/base.py | 2 +- .../ipchooser/serializers/host_sers.py | 2 +- .../ipchooser/serializers/topo_sers.py | 2 +- dbm-ui/backend/db_services/ipchooser/views.py | 2 +- .../db_services/meta_import/constants.py | 2 +- .../db_services/meta_import/serializers.py | 10 +- .../backend/db_services/meta_import/urls.py | 2 +- .../backend/db_services/meta_import/views.py | 36 +- .../permission/db_authorize/handlers.py | 2 +- .../mongodb/permission/db_authorize/views.py | 2 +- .../db_services/mongodb/resources/query.py | 2 +- .../db_services/mongodb/resources/views.py | 2 +- .../db_services/mongodb/restore/handlers.py | 2 +- .../mongodb/restore/serializers.py | 2 +- .../db_services/mongodb/restore/views.py | 2 +- .../db_services/mysql/cluster/views.py | 2 +- .../db_services/mysql/dumper/filters.py | 2 +- .../db_services/mysql/dumper/models.py | 2 +- .../mysql/dumper/views/dumper_config.py | 2 +- .../mysql/dumper/views/dumper_instance.py | 2 +- .../mysql/fixpoint_rollback/handlers.py | 2 +- .../mysql/fixpoint_rollback/serializers.py | 2 +- .../mysql/fixpoint_rollback/views.py | 2 +- .../db_services/mysql/open_area/exceptions.py | 2 +- .../db_services/mysql/open_area/filters.py | 2 +- .../db_services/mysql/open_area/handlers.py | 2 +- .../db_services/mysql/open_area/models.py | 2 +- .../mysql/open_area/serializers.py | 2 +- .../db_services/mysql/open_area/views.py | 2 +- .../mysql/permission/authorize/handlers.py | 2 +- .../mysql/permission/authorize/views.py | 2 +- .../mysql/permission/clone/handlers.py | 2 +- .../mysql/permission/clone/models.py | 2 +- .../mysql/permission/clone/views.py | 2 +- .../db_services/mysql/permission/constants.py | 2 +- .../mysql/permission/db_account/handlers.py | 2 +- .../mysql/permission/exceptions.py | 2 +- .../mysql/remote_service/exceptions.py | 2 +- .../mysql/remote_service/handlers.py | 2 +- .../db_services/mysql/remote_service/views.py | 2 +- .../mysql/resources/mysqlonk8s/__init__.py | 10 + .../mysql/resources/mysqlonk8s/query.py | 21 + .../mysql/resources/mysqlonk8s/views.py | 56 ++ .../mysql/resources/mysqlonk8s/yasg_slz.py | 39 ++ .../mysql/resources/tendbcluster/query.py | 2 +- .../mysql/resources/tendbha/query.py | 2 +- .../mysql/resources/tendbsingle/query.py | 2 +- .../db_services/mysql/resources/urls.py | 2 + .../db_services/mysql/resources/views.py | 2 +- .../mysql/sql_import/exceptions.py | 2 +- .../db_services/mysql/sql_import/handlers.py | 2 +- .../db_services/mysql/sql_import/mock_data.py | 2 +- .../db_services/mysql/sql_import/views.py | 2 +- .../db_services/partition/constants.py | 2 +- .../db_services/partition/exceptions.py | 2 +- .../backend/db_services/partition/handlers.py | 2 +- .../db_services/partition/serializers.py | 2 +- dbm-ui/backend/db_services/partition/views.py | 2 +- .../plugin/mysql/authorize/views.py | 2 +- .../db_services/quick_search/constants.py | 2 +- .../db_services/quick_search/serializers.py | 2 +- .../backend/db_services/quick_search/views.py | 2 +- .../backend/db_services/redis/autofix/bill.py | 2 +- .../db_services/redis/autofix/enums.py | 2 +- .../db_services/redis/autofix/models.py | 2 +- dbm-ui/backend/db_services/redis/constants.py | 2 +- .../db_services/redis/redis_dts/constants.py | 2 +- .../db_services/redis/redis_dts/exceptions.py | 2 +- .../redis_dts/migrate_cluster_password.py | 2 +- .../models/tb_dts_distribute_lock.py | 2 +- .../redis/redis_dts/models/tb_dts_server.py | 2 +- .../redis_dts/models/tb_tendis_dts_job.py | 2 +- .../redis_dts/models/tb_tendis_dts_task.py | 2 +- .../db_services/redis/redis_dts/util.py | 2 +- .../db_services/redis/redis_dts/views.py | 2 +- .../redis/resources/redis_cluster/query.py | 2 +- .../redis/resources/redis_cluster/views.py | 2 +- .../db_services/redis/resources/views.py | 2 +- .../db_services/redis/rollback/handlers.py | 2 +- .../tb_tendis_data_construction_task.py | 2 +- .../db_services/redis/rollback/views.py | 2 +- .../models/slots_migration_record.py | 2 +- .../db_services/redis/toolbox/views.py | 2 +- .../db_services/taskflow/exceptions.py | 2 +- .../db_services/taskflow/serializers.py | 2 +- dbm-ui/backend/db_services/taskflow/task.py | 2 +- .../db_services/taskflow/views/flow.py | 2 +- .../db_services/taskflow/views/redis.py | 2 +- dbm-ui/backend/db_services/user/views.py | 2 +- dbm-ui/backend/db_services/version/views.py | 2 +- dbm-ui/backend/dbm_init/apps.py | 2 +- .../management/commands/cloud_component.py | 2 +- dbm-ui/backend/env/__init__.py | 4 +- dbm-ui/backend/env/apigw_domains.py | 1 - .../backend/env/{dev.py => db_extention.py} | 16 +- dbm-ui/backend/exceptions.py | 2 +- dbm-ui/backend/flow/consts.py | 1 - dbm-ui/backend/flow/engine/bamboo/engine.py | 2 +- .../bamboo/scene/cloud/base_service_flow.py | 2 +- .../bamboo/scene/cloud/dbha_service_flow.py | 2 +- .../bamboo/scene/cloud/dns_service_flow.py | 2 +- .../bamboo/scene/cloud/drs_service_flow.py | 2 +- .../bamboo/scene/cloud/nginx_service_flow.py | 2 +- .../cloud/redis_dts_server_service_flow.py | 2 +- .../scene/common/atom_jobs/set_dns_sub_job.py | 2 +- .../engine/bamboo/scene/common/builder.py | 2 +- .../bamboo/scene/common/machine_os_init.py | 2 +- .../engine/bamboo/scene/es/es_apply_flow.py | 2 +- .../engine/bamboo/scene/es/es_destroy_flow.py | 2 +- .../engine/bamboo/scene/es/es_disable_flow.py | 2 +- .../engine/bamboo/scene/es/es_enable_flow.py | 2 +- .../bamboo/scene/es/es_fake_apply_flow.py | 2 +- .../engine/bamboo/scene/es/es_reboot_flow.py | 2 +- .../engine/bamboo/scene/es/es_replace_flow.py | 2 +- .../bamboo/scene/es/es_scale_up_flow.py | 2 +- .../engine/bamboo/scene/es/es_shrink_flow.py | 2 +- .../engine/bamboo/scene/hdfs/exceptions.py | 2 +- .../bamboo/scene/hdfs/hdfs_apply_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_destroy_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_disable_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_enable_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_fake_apply_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_reboot_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_replace_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_scale_up_flow.py | 2 +- .../bamboo/scene/hdfs/hdfs_shrink_flow.py | 2 +- .../engine/bamboo/scene/hdfs/hdfs_sub_flow.py | 2 +- .../scene/influxdb/influxdb_apply_flow.py | 2 +- .../scene/influxdb/influxdb_destroy_flow.py | 2 +- .../scene/influxdb/influxdb_disable_flow.py | 2 +- .../scene/influxdb/influxdb_enable_flow.py | 2 +- .../influxdb/influxdb_fake_apply_flow.py | 2 +- .../scene/influxdb/influxdb_reboot_flow.py | 2 +- .../scene/influxdb/influxdb_replace_flow.py | 2 +- .../bamboo/scene/kafka/kafka_apply_flow.py | 2 +- .../bamboo/scene/kafka/kafka_destroy_flow.py | 2 +- .../bamboo/scene/kafka/kafka_disable_flow.py | 2 +- .../bamboo/scene/kafka/kafka_enable_flow.py | 2 +- .../scene/kafka/kafka_fake_apply_flow.py | 2 +- .../bamboo/scene/kafka/kafka_reboot_flow.py | 2 +- .../bamboo/scene/kafka/kafka_replace_flow.py | 2 +- .../bamboo/scene/kafka/kafka_scale_up_flow.py | 2 +- .../bamboo/scene/kafka/kafka_shrink_flow.py | 2 +- .../bamboo/scene/mongodb/mongodb_backup.py | 2 +- .../bamboo/scene/mongodb/mongodb_deinstall.py | 2 +- .../scene/mongodb/mongodb_fake_install.py | 2 +- .../bamboo/scene/mongodb/mongodb_install.py | 2 +- .../bamboo/scene/mongodb/mongodb_remove_ns.py | 2 +- .../bamboo/scene/mongodb/mongodb_restore.py | 2 +- .../bamboo/scene/mongodb/sub_task/backup.py | 2 +- .../scene/mongodb/sub_task/cluster_replace.py | 2 +- .../scene/mongodb/sub_task/deinstall.py | 2 +- .../mongodb/sub_task/download_subtask.py | 2 +- .../scene/mongodb/sub_task/exec_script.py | 2 +- .../mongodb/sub_task/instance_restart.py | 2 +- .../scene/mongodb/sub_task/mongod_replace.py | 2 +- .../scene/mongodb/sub_task/mongos_install.py | 2 +- .../scene/mongodb/sub_task/mongos_replace.py | 2 +- .../scene/mongodb/sub_task/remove_ns.py | 2 +- .../mongodb/sub_task/replicaset_install.py | 2 +- .../mongodb/sub_task/replicaset_replace.py | 2 +- .../scene/mongodb/sub_task/restore_sub.py | 2 +- .../bamboo/scene/mongodb/sub_task/user.py | 2 +- .../bamboo/scene/mysql/common/exceptions.py | 2 +- .../scene/mysql/common/get_local_backup.py | 2 +- .../mysql/common/master_and_slave_switch.py | 2 +- .../common/mysql_resotre_data_sub_flow.py | 2 +- .../mysql/common/recover_slave_instance.py | 2 +- .../mysql/common/slave_recover_switch.py | 2 +- .../scene/mysql/common/uninstall_instance.py | 2 +- .../bamboo/scene/mysql/import_sqlfile_flow.py | 2 +- .../scene/mysql/mysql_authorize_rules.py | 2 +- .../bamboo/scene/mysql/mysql_checksum.py | 2 +- .../bamboo/scene/mysql/mysql_clone_rules.py | 2 +- .../scene/mysql/mysql_edit_config_flow.py | 2 +- .../mysql/mysql_fake_sql_semantic_check.py | 2 +- .../scene/mysql/mysql_flashback_flow.py | 2 +- .../bamboo/scene/mysql/mysql_ha_apply_flow.py | 2 +- .../scene/mysql/mysql_ha_db_table_backup.py | 2 +- .../scene/mysql/mysql_ha_destroy_flow.py | 2 +- .../scene/mysql/mysql_ha_disable_flow.py | 2 +- .../scene/mysql/mysql_ha_enable_flow.py | 2 +- .../scene/mysql/mysql_ha_full_backup_flow.py | 2 +- .../scene/mysql/mysql_ha_metadata_import.py | 2 +- .../scene/mysql/mysql_ha_standardize_flow.py | 2 +- .../scene/mysql/mysql_master_fail_over.py | 2 +- .../scene/mysql/mysql_master_slave_switch.py | 2 +- .../scene/mysql/mysql_migrate_cluster_flow.py | 2 +- .../mysql_migrate_cluster_remote_flow.py | 2 +- .../scene/mysql/mysql_open_area_flow.py | 2 +- .../bamboo/scene/mysql/mysql_partition.py | 2 +- .../scene/mysql/mysql_proxy_cluster_add.py | 2 +- .../scene/mysql/mysql_proxy_cluster_switch.py | 2 +- .../bamboo/scene/mysql/mysql_proxy_upgrade.py | 2 +- .../scene/mysql/mysql_random_password.py | 2 +- .../scene/mysql/mysql_rename_database_flow.py | 2 +- .../scene/mysql/mysql_restore_slave_flow.py | 2 +- .../mysql/mysql_restore_slave_remote_flow.py | 2 +- .../scene/mysql/mysql_rollback_data_flow.py | 2 +- .../mysql/mysql_rollback_data_sub_flow.py | 2 +- .../scene/mysql/mysql_single_apply_flow.py | 2 +- .../scene/mysql/mysql_single_destroy_flow.py | 2 +- .../scene/mysql/mysql_single_disable_flow.py | 2 +- .../scene/mysql/mysql_single_enable_flow.py | 2 +- .../bamboo/scene/mysql/mysql_truncate_flow.py | 2 +- .../bamboo/scene/mysql/pt_table_sync.py | 2 +- .../bamboo/scene/name_service/name_service.py | 2 +- .../engine/bamboo/scene/pulsar/exceptions.py | 2 +- .../bamboo/scene/pulsar/pulsar_apply_flow.py | 2 +- .../bamboo/scene/pulsar/pulsar_base_flow.py | 2 +- .../scene/pulsar/pulsar_destroy_flow.py | 2 +- .../scene/pulsar/pulsar_disable_flow.py | 2 +- .../bamboo/scene/pulsar/pulsar_enable_flow.py | 2 +- .../scene/pulsar/pulsar_fake_apply_flow.py | 2 +- .../bamboo/scene/pulsar/pulsar_reboot_flow.py | 2 +- .../scene/pulsar/pulsar_replace_flow.py | 2 +- .../scene/pulsar/pulsar_scale_up_flow.py | 2 +- .../bamboo/scene/pulsar/pulsar_shrink_flow.py | 2 +- .../bamboo/scene/pulsar/pulsar_sub_flow.py | 2 +- .../scene/redis/atom_jobs/access_manager.py | 2 +- .../predixy_config_servers_rewrite.py | 2 +- .../scene/redis/atom_jobs/proxy_install.py | 2 +- .../scene/redis/atom_jobs/proxy_uninstall.py | 2 +- .../atom_jobs/redis_cluster_master_rep.py | 2 +- .../atom_jobs/redis_cluster_slave_rep.py | 2 +- .../scene/redis/atom_jobs/redis_dbmon.py | 2 +- .../bamboo/scene/redis/atom_jobs/redis_dts.py | 2 +- .../scene/redis/atom_jobs/redis_install.py | 2 +- .../scene/redis/atom_jobs/redis_makesync.py | 2 +- .../scene/redis/atom_jobs/redis_repair.py | 2 +- .../scene/redis/atom_jobs/redis_shutdown.py | 2 +- .../scene/redis/atom_jobs/redis_switch.py | 2 +- .../atom_jobs/reupload_old_backup_records.py | 2 +- .../bamboo/scene/redis/common/exceptions.py | 2 +- .../scene/redis/redis_add_dts_server.py | 2 +- .../bamboo/scene/redis/redis_backend_scale.py | 2 +- .../scene/redis/redis_cluster_add_slave.py | 2 +- .../scene/redis/redis_cluster_backup.py | 2 +- .../redis/redis_cluster_data_check_repair.py | 2 +- .../scene/redis/redis_cluster_data_copy.py | 2 +- .../redis/redis_cluster_instance_shutdown.py | 2 +- .../scene/redis/redis_cluster_migrate_load.py | 2 +- .../scene/redis/redis_cluster_open_close.py | 2 +- .../redis/redis_cluster_scene_auotfix.py | 2 +- .../scene/redis/redis_cluster_scene_cmr.py | 2 +- .../scene/redis/redis_cluster_scene_mss.py | 2 +- .../scene/redis/redis_cluster_shutdown.py | 2 +- .../redis_cluster_version_update_online.py | 2 +- .../scene/redis/redis_data_structure.py | 2 +- .../scene/redis/redis_data_structure_sub.py | 2 +- .../redis/redis_data_structure_task_delete.py | 2 +- .../bamboo/scene/redis/redis_flush_data.py | 2 +- .../scene/redis/redis_instance_apply_flow.py | 2 +- .../bamboo/scene/redis/redis_keys_delete.py | 2 +- .../bamboo/scene/redis/redis_keys_extract.py | 2 +- .../redis/redis_predixy_cluster_apply_flow.py | 2 +- .../bamboo/scene/redis/redis_proxy_scale.py | 2 +- .../scene/redis/redis_remove_dts_server.py | 2 +- .../bamboo/scene/redis/redis_slots_migrate.py | 2 +- .../scene/redis/redis_slots_migrate_sub.py | 2 +- .../redis_twemproxy_cluster_apply_flow.py | 2 +- .../scene/redis/singele_redis_shutdown.py | 2 +- .../scene/riak/riak_cluster_apply_flow.py | 2 +- .../scene/riak/riak_cluster_destroy_flow.py | 2 +- .../scene/riak/riak_cluster_disable_flow.py | 2 +- .../scene/riak/riak_cluster_enable_flow.py | 2 +- .../scene/riak/riak_cluster_migrate_flow.py | 2 +- .../scene/riak/riak_cluster_reboot_flow.py | 2 +- .../scene/riak/riak_cluster_scale_in_flow.py | 2 +- .../scene/riak/riak_cluster_scale_out_flow.py | 2 +- .../scene/spider/append_deploy_ctl_flow.py | 2 +- .../scene/spider/common/common_sub_flow.py | 2 +- .../bamboo/scene/spider/common/exceptions.py | 2 +- .../scene/spider/import_sqlfile_flow.py | 2 +- .../spider/remote_local_slave_recover.py | 2 +- .../spider/remote_master_slave_swtich.py | 2 +- .../scene/spider/remote_slave_recover.py | 2 +- .../bamboo/scene/spider/spider_add_mnt.py | 2 +- .../bamboo/scene/spider/spider_add_nodes.py | 2 +- .../bamboo/scene/spider/spider_checksum.py | 2 +- .../spider/spider_cluster_db_table_backup.py | 2 +- .../scene/spider/spider_cluster_deploy.py | 2 +- .../scene/spider/spider_cluster_destroy.py | 2 +- .../spider/spider_cluster_disable_deploy.py | 2 +- .../spider/spider_cluster_enable_deploy.py | 2 +- .../scene/spider/spider_cluster_flashback.py | 2 +- .../spider/spider_cluster_full_backup.py | 2 +- .../spider_cluster_metadata_import_flow.py | 2 +- .../spider/spider_cluster_rollback_flow.py | 2 +- .../spider/spider_cluster_standardize_flow.py | 2 +- .../spider_cluster_truncate_database.py | 2 +- .../bamboo/scene/spider/spider_partition.py | 2 +- .../bamboo/scene/spider/spider_recover.py | 2 +- .../bamboo/scene/spider/spider_reduce_mnt.py | 2 +- .../scene/spider/spider_reduce_nodes.py | 2 +- .../spider/spider_remote_node_migrate.py | 2 +- .../spider/spider_remotedb_migrate_flow.py | 2 +- .../spider/spider_remotedb_rebalance_flow.py | 2 +- .../spider/spider_rename_database_flow.py | 2 +- .../spider/spider_slave_cluster_deploy.py | 2 +- .../spider/spider_slave_cluster_destroy.py | 2 +- .../scene/sqlserver/build_database_sync.py | 2 +- .../bamboo/scene/sqlserver/common_sub_flow.py | 2 +- .../scene/sqlserver/sqlserver_add_slave.py | 2 +- .../scene/sqlserver/sqlserver_backup_dbs.py | 2 +- .../scene/sqlserver/sqlserver_clean_dbs.py | 2 +- .../sqlserver/sqlserver_cluster_destroy.py | 2 +- .../sqlserver/sqlserver_cluster_disable.py | 2 +- .../sqlserver/sqlserver_cluster_enable.py | 2 +- .../sqlserver/sqlserver_cluster_reset.py | 2 +- .../scene/sqlserver/sqlserver_ha_deploy.py | 2 +- .../sqlserver_master_slave_switch.py | 2 +- .../scene/sqlserver/sqlserver_rename_dbs.py | 2 +- .../sqlserver/sqlserver_single_deploy.py | 2 +- .../sqlserver/sqlserver_slave_rebuild.py | 2 +- .../scene/sqlserver/sqlserver_sql_execute.py | 2 +- .../bamboo/scene/tbinlogdumper/add_nodes.py | 2 +- .../tbinlogdumper/common/common_sub_flow.py | 2 +- .../scene/tbinlogdumper/common/exceptions.py | 2 +- .../bamboo/scene/tbinlogdumper/common/util.py | 2 +- .../scene/tbinlogdumper/disable_nodes.py | 2 +- .../scene/tbinlogdumper/enable_nodes.py | 2 +- .../bamboo/scene/tbinlogdumper/reduce_node.py | 2 +- .../scene/tbinlogdumper/switch_nodes.py | 2 +- dbm-ui/backend/flow/engine/exceptions.py | 2 +- dbm-ui/backend/flow/models.py | 2 +- .../collections/cloud/exec_service_script.py | 2 +- .../collections/cloud/push_config_file.py | 2 +- .../collections/cloud/trans_files.py | 2 +- .../collections/common/L5_agent_install.py | 2 +- .../collections/common/base_service.py | 2 +- .../common/bigdata_manager_service.py | 2 +- .../collections/common/check_resolv_conf.py | 2 +- .../collections/common/clb_manage.py | 2 +- .../common/create_random_job_user.py | 2 +- .../collections/common/create_ticket.py | 2 +- .../collections/common/dns_server.py | 2 +- .../common/drop_random_job_user.py | 2 +- .../collections/common/external_service.py | 2 +- .../components/collections/common/pause.py | 2 +- .../collections/common/polaris_manage.py | 2 +- .../collections/common/sa_idle_check.py | 2 +- .../components/collections/common/sa_init.py | 2 +- .../collections/common/sleep_time_service.py | 2 +- .../common/transfer_host_service.py | 2 +- .../collections/es/es_dns_manage.py | 2 +- .../collections/es/exec_es_actuator_script.py | 2 +- .../collections/es/get_es_resource.py | 2 +- .../components/collections/es/trans_files.py | 2 +- .../collections/hdfs/exec_actuator_script.py | 2 +- .../collections/hdfs/get_hdfs_resource.py | 2 +- .../collections/hdfs/hdfs_dns_manage.py | 2 +- .../collections/hdfs/trans_flies.py | 2 +- .../collections/hdfs/update_hdfs_resource.py | 2 +- .../influxdb/exec_actuator_script.py | 2 +- .../collections/influxdb/trans_flies.py | 2 +- .../collections/kafka/dns_manage.py | 2 +- .../collections/kafka/exec_actuator_script.py | 2 +- .../collections/kafka/get_kafka_resource.py | 2 +- .../collections/kafka/trans_flies.py | 2 +- .../collections/mongodb/exec_actuator_job.py | 2 +- .../collections/mongodb/exec_actuator_job2.py | 2 +- .../collections/mongodb/fast_exec_script.py | 2 +- .../mongodb/mongo_download_backup_files.py | 2 +- .../mongodb/mongo_shutdown_meta.py | 2 +- .../collections/mongodb/send_media.py | 2 +- .../collections/mysql/authorize_rules.py | 2 +- .../build_database_table_filter_regex.py | 2 +- .../collections/mysql/clear_machine.py | 2 +- .../collections/mysql/clone_rules.py | 2 +- .../collections/mysql/clone_user.py | 2 +- .../mysql/cluster_standardize_trans_module.py | 2 +- .../collections/mysql/create_user.py | 2 +- .../collections/mysql/dns_manage.py | 2 +- .../components/collections/mysql/drop_user.py | 2 +- .../collections/mysql/exec_actuator_script.py | 2 +- .../collections/mysql/fake_semantic_check.py | 2 +- .../mysql/filter_database_table_from_regex.py | 2 +- .../mysql/mysql_checksum_report.py | 2 +- .../mysql/mysql_cluster_instantiate_config.py | 2 +- .../collections/mysql/mysql_db_meta.py | 2 +- .../mysql/mysql_download_backupfile.py | 2 +- .../mysql/mysql_ha_import_metadata.py | 2 +- .../mysql/mysql_ha_modify_cluster_phase.py | 2 +- .../mysql/mysql_link_backup_id_bill_id.py | 2 +- .../mysql_master_slave_relationship_check.py | 2 +- .../mysql_rollback_data_download_binlog.py | 2 +- .../mysql/randomize_admin_password.py | 2 +- .../rename_database_confirm_empty_from.py | 2 +- .../mysql/rename_database_drop_from.py | 2 +- .../mysql/rename_database_prepare_param.py | 2 +- .../collections/mysql/rollback_trans_flies.py | 2 +- .../collections/mysql/semantic_check.py | 2 +- .../collections/mysql/slave_trans_flies.py | 2 +- .../collections/mysql/trans_flies.py | 2 +- .../truncate_data_create_stage_database.py | 2 +- .../truncate_data_drop_stage_database.py | 2 +- ...ncate_data_generate_stage_database_name.py | 2 +- .../mysql/truncate_data_recreate_table.py | 2 +- .../mysql/truncate_data_rename_table.py | 2 +- .../collections/mysql/upload_file.py | 2 +- .../pulsar/blank_schedule_service.py | 2 +- .../pulsar/exec_actuator_script.py | 2 +- .../collections/pulsar/pulsar_dns_manage.py | 2 +- .../pulsar/pulsar_zk_dns_manage.py | 2 +- .../collections/pulsar/trans_files.py | 2 +- .../collections/redis/dns_manage.py | 2 +- .../collections/redis/exec_actuator_script.py | 2 +- .../exec_data_structure_actuator_script.py | 2 +- .../collections/redis/exec_shell_script.py | 2 +- .../collections/redis/get_redis_payload.py | 2 +- .../redis/psuh_data_structure_json_script.py | 2 +- .../collections/redis/redis_db_meta.py | 2 +- .../redis/redis_download_backup_files.py | 2 +- .../components/collections/redis/redis_dts.py | 2 +- .../collections/redis/redis_ticket.py | 2 +- .../collections/redis/redis_trans_files.py | 2 +- .../collections/redis/trans_flies.py | 2 +- .../collections/riak/exec_actuator_script.py | 2 +- .../collections/riak/get_riak_cluster_node.py | 2 +- .../collections/riak/get_riak_resource.py | 2 +- .../collections/riak/trans_files.py | 2 +- .../collections/spider/add_spider_routing.py | 2 +- .../spider/add_system_user_in_cluster.py | 2 +- .../spider/check_cluster_table_using_sub.py | 2 +- .../clear_database_on_remote_service.py | 2 +- .../spider/create_database_like_via_ctl.py | 2 +- .../collections/spider/ctl_drop_routing.py | 2 +- .../collections/spider/ctl_switch_to_slave.py | 2 +- .../collections/spider/drop_spider_ronting.py | 2 +- .../spider/drop_spider_table_via_ctl.py | 2 +- .../collections/spider/import_metadata.py | 2 +- .../collections/spider/spider_db_meta.py | 2 +- ...truncate_database_drop_stage_db_via_ctl.py | 2 +- .../truncate_database_on_spider_via_ctl.py | 2 +- .../sqlserver/exec_actuator_script.py | 2 +- .../collections/sqlserver/trans_files.py | 2 +- dbm-ui/backend/flow/signal/handlers.py | 2 +- .../flow/utils/base/payload_handler.py | 133 ++--- .../flow/utils/cloud/cloud_act_payload.py | 2 +- .../flow/utils/cloud/cloud_db_proxy.py | 2 +- .../flow/utils/cloud/cloud_module_operate.py | 2 +- dbm-ui/backend/flow/utils/es/es_db_meta.py | 2 +- .../backend/flow/utils/hdfs/hdfs_db_meta.py | 2 +- .../flow/utils/influxdb/influxdb_db_meta.py | 2 +- .../backend/flow/utils/kafka/kafka_db_meta.py | 2 +- .../flow/utils/mongodb/db_table_filter.py | 2 +- .../backend/flow/utils/mysql/db_resource.py | 2 +- .../utils/mysql/db_table_filter/exception.py | 2 +- .../utils/mysql/db_table_filter/filter.py | 2 +- .../flow/utils/mysql/db_table_filter/tools.py | 2 +- .../mysql/mysql_act_dataclass_validator.py | 2 +- .../flow/utils/mysql/mysql_act_playload.py | 2 +- .../flow/utils/redis/redis_act_playload.py | 6 +- .../backend/flow/utils/redis/redis_db_meta.py | 2 +- .../flow/utils/redis/redis_proxy_util.py | 2 +- .../flow/utils/spider/get_spider_incr.py | 2 +- .../flow/utils/sqlserver/payload_handler.py | 22 +- .../utils/sqlserver/sqlserver_act_payload.py | 2 +- .../tbinlogdumper_act_payload.py | 2 +- .../backend/flow/views/append_deploy_ctl.py | 2 +- dbm-ui/backend/flow/views/base.py | 2 +- dbm-ui/backend/flow/views/cloud_dbha_apply.py | 2 +- .../flow/views/cloud_dns_bind_apply.py | 2 +- dbm-ui/backend/flow/views/cloud_drs_apply.py | 2 +- .../backend/flow/views/cloud_nginx_apply.py | 2 +- .../views/cloud_redis_dts_server_apply.py | 2 +- dbm-ui/backend/flow/views/es_apply.py | 2 +- dbm-ui/backend/flow/views/es_destroy.py | 2 +- dbm-ui/backend/flow/views/es_disable.py | 2 +- dbm-ui/backend/flow/views/es_enable.py | 2 +- dbm-ui/backend/flow/views/es_reboot.py | 2 +- dbm-ui/backend/flow/views/es_replace.py | 2 +- dbm-ui/backend/flow/views/es_scale_up.py | 2 +- dbm-ui/backend/flow/views/es_shrink.py | 2 +- dbm-ui/backend/flow/views/hdfs_apply.py | 2 +- dbm-ui/backend/flow/views/hdfs_destroy.py | 2 +- dbm-ui/backend/flow/views/hdfs_disable.py | 2 +- dbm-ui/backend/flow/views/hdfs_enable.py | 2 +- dbm-ui/backend/flow/views/hdfs_reboot.py | 2 +- dbm-ui/backend/flow/views/hdfs_replace.py | 2 +- dbm-ui/backend/flow/views/hdfs_scale_up.py | 2 +- dbm-ui/backend/flow/views/hdfs_shrink.py | 2 +- dbm-ui/backend/flow/views/influxdb_apply.py | 2 +- dbm-ui/backend/flow/views/influxdb_destroy.py | 2 +- dbm-ui/backend/flow/views/influxdb_disable.py | 2 +- dbm-ui/backend/flow/views/influxdb_enable.py | 2 +- dbm-ui/backend/flow/views/influxdb_reboot.py | 2 +- dbm-ui/backend/flow/views/influxdb_replace.py | 2 +- dbm-ui/backend/flow/views/kafka_apply.py | 2 +- dbm-ui/backend/flow/views/kafka_destroy.py | 2 +- dbm-ui/backend/flow/views/kafka_disable.py | 2 +- dbm-ui/backend/flow/views/kafka_enable.py | 2 +- dbm-ui/backend/flow/views/kafka_reboot.py | 2 +- dbm-ui/backend/flow/views/kafka_replace.py | 2 +- dbm-ui/backend/flow/views/kafka_scale_up.py | 2 +- dbm-ui/backend/flow/views/kafka_shrink.py | 2 +- .../flow/views/migrate_views/es_fake_apply.py | 2 +- .../views/migrate_views/hdfs_fake_apply.py | 2 +- .../migrate_views/influxdb_fake_apply.py | 2 +- .../views/migrate_views/kafka_fake_apply.py | 2 +- .../flow/views/migrate_views/riak_migrate.py | 2 +- dbm-ui/backend/flow/views/mysql_add_slave.py | 2 +- .../flow/views/mysql_add_slave_remote.py | 2 +- .../backend/flow/views/mysql_edit_config.py | 2 +- dbm-ui/backend/flow/views/mysql_flashback.py | 2 +- .../flow/views/mysql_ha_db_table_backup.py | 2 +- dbm-ui/backend/flow/views/mysql_ha_destroy.py | 2 +- .../flow/views/mysql_ha_full_backup.py | 2 +- .../flow/views/mysql_ha_master_fail_over.py | 2 +- .../flow/views/mysql_ha_rename_database.py | 2 +- dbm-ui/backend/flow/views/mysql_ha_switch.py | 2 +- .../flow/views/mysql_ha_truncate_data.py | 2 +- .../flow/views/mysql_migrate_cluster.py | 2 +- .../views/mysql_migrate_cluster_remote.py | 2 +- dbm-ui/backend/flow/views/mysql_proxy_add.py | 2 +- .../backend/flow/views/mysql_proxy_reduce.py | 2 +- .../backend/flow/views/mysql_proxy_switch.py | 2 +- .../backend/flow/views/mysql_proxy_upgrade.py | 2 +- .../backend/flow/views/mysql_pt_table_sync.py | 2 +- .../flow/views/mysql_restore_local_remote.py | 2 +- .../flow/views/mysql_restore_local_slave.py | 2 +- .../backend/flow/views/mysql_restore_slave.py | 2 +- .../flow/views/mysql_restore_slave_remote.py | 2 +- .../backend/flow/views/mysql_rollback_data.py | 2 +- .../backend/flow/views/mysql_single_apply.py | 2 +- .../flow/views/mysql_single_destroy.py | 2 +- .../views/mysql_single_rename_database.py | 2 +- .../flow/views/mysql_single_truncate_data.py | 2 +- dbm-ui/backend/flow/views/pulsar_destroy.py | 2 +- dbm-ui/backend/flow/views/pulsar_disable.py | 2 +- dbm-ui/backend/flow/views/pulsar_enable.py | 2 +- dbm-ui/backend/flow/views/pulsar_reboot.py | 2 +- dbm-ui/backend/flow/views/pulsar_replace.py | 2 +- dbm-ui/backend/flow/views/pulsar_shrink.py | 2 +- .../spider_cluster_database_table_backup.py | 2 +- .../flow/views/spider_cluster_destroy.py | 6 +- .../flow/views/spider_cluster_flashback.py | 2 +- .../flow/views/spider_cluster_full_backup.py | 2 +- .../views/spider_cluster_rename_database.py | 2 +- .../flow/views/spider_cluster_standardize.py | 2 +- .../views/spider_cluster_truncate_database.py | 2 +- .../flow/views/tendb_ha_standardize.py | 2 +- dbm-ui/backend/iam_app/dataclass/__init__.py | 2 +- dbm-ui/backend/iam_app/dataclass/actions.py | 2 +- dbm-ui/backend/iam_app/dataclass/resources.py | 2 +- dbm-ui/backend/iam_app/exceptions.py | 4 +- .../iam_app/handlers/drf_perm/monitor.py | 2 +- .../iam_app/handlers/drf_perm/openarea.py | 2 +- .../iam_app/handlers/drf_perm/proxypass.py | 2 +- dbm-ui/backend/iam_app/handlers/permission.py | 2 +- dbm-ui/backend/iam_app/serializers.py | 2 +- .../backend/iam_app/views/cluster_provider.py | 2 +- dbm-ui/backend/iam_app/views/views.py | 2 +- .../db_meta/api/cluster/base/__init__.py | 10 + .../db_meta/api/cluster/base/test_handler.py | 68 +++ .../mysql/permission/test_account_handler.py | 2 +- .../permission/test_authorize_handler.py | 2 +- .../mysql/permission/test_clone_handler.py | 2 +- .../mysql/remote_service/test_handlers.py | 5 +- .../mysql/test_exec_actuator_script.py | 2 +- .../components/collections/mysql/utils.py | 4 +- .../backend/tests/mock_data/components/cc.py | 10 +- .../mock_data/components/db_remote_service.py | 10 - .../tests/mock_data/components/dbconfig.py | 4 + ...ysql_priv_manager.py => dbpriv_manager.py} | 2 +- .../backend/tests/mock_data/flow/__init__.py | 10 + .../mock_data/flow/components/__init__.py | 10 + .../flow/components/collections/__init__.py | 10 + dbm-ui/backend/tests/mock_data/utils.py | 2 +- dbm-ui/backend/ticket/builders/__init__.py | 2 +- .../backend/ticket/builders/cloud/dbha_add.py | 2 +- .../ticket/builders/cloud/dbha_reduce.py | 2 +- .../ticket/builders/cloud/dbha_reload.py | 2 +- .../ticket/builders/cloud/dbha_replace.py | 2 +- .../backend/ticket/builders/cloud/dns_add.py | 2 +- .../ticket/builders/cloud/dns_reduce.py | 2 +- .../ticket/builders/cloud/dns_reload.py | 2 +- .../ticket/builders/cloud/dns_replace.py | 2 +- .../backend/ticket/builders/cloud/drs_add.py | 2 +- .../ticket/builders/cloud/drs_reduce.py | 2 +- .../ticket/builders/cloud/drs_reload.py | 2 +- .../ticket/builders/cloud/drs_replace.py | 2 +- .../ticket/builders/cloud/nginx_reload.py | 2 +- .../ticket/builders/cloud/nginx_replace.py | 2 +- .../ticket/builders/cloud/redis_dts_add.py | 2 +- .../ticket/builders/cloud/redis_dts_reduce.py | 2 +- .../ticket/builders/cloud/service_apply.py | 2 +- .../backend/ticket/builders/common/bigdata.py | 2 +- dbm-ui/backend/ticket/builders/es/es_apply.py | 2 +- .../backend/ticket/builders/es/es_destroy.py | 2 +- .../backend/ticket/builders/es/es_disable.py | 2 +- .../backend/ticket/builders/es/es_enable.py | 2 +- .../backend/ticket/builders/es/es_reboot.py | 2 +- .../backend/ticket/builders/es/es_replace.py | 2 +- .../backend/ticket/builders/es/es_scale_up.py | 2 +- .../ticket/builders/hdfs/hdfs_apply.py | 2 +- .../ticket/builders/hdfs/hdfs_destroy.py | 2 +- .../ticket/builders/hdfs/hdfs_disable.py | 2 +- .../ticket/builders/hdfs/hdfs_enable.py | 2 +- .../ticket/builders/hdfs/hdfs_reboot.py | 2 +- .../ticket/builders/hdfs/hdfs_replace.py | 2 +- .../ticket/builders/hdfs/hdfs_scale_up.py | 2 +- .../builders/influxdb/influxdb_apply.py | 2 +- .../builders/influxdb/influxdb_destroy.py | 2 +- .../builders/influxdb/influxdb_disable.py | 2 +- .../builders/influxdb/influxdb_enable.py | 2 +- .../builders/influxdb/influxdb_reboot.py | 2 +- .../builders/influxdb/influxdb_replace.py | 2 +- .../ticket/builders/kafka/kafka_apply.py | 2 +- .../ticket/builders/kafka/kafka_destroy.py | 2 +- .../ticket/builders/kafka/kafka_disable.py | 2 +- .../ticket/builders/kafka/kafka_enable.py | 2 +- .../ticket/builders/kafka/kafka_reboot.py | 2 +- .../ticket/builders/kafka/kafka_replace.py | 2 +- .../ticket/builders/kafka/kafka_scale_up.py | 2 +- .../backend/ticket/builders/mongodb/base.py | 2 +- .../builders/mongodb/mongo_add_mongos.py | 2 +- .../builders/mongodb/mongo_add_shard_nodes.py | 2 +- .../builders/mongodb/mongo_authorize.py | 2 +- .../ticket/builders/mongodb/mongo_backup.py | 2 +- .../ticket/builders/mongodb/mongo_clear.py | 2 +- .../ticket/builders/mongodb/mongo_cutoff.py | 2 +- .../ticket/builders/mongodb/mongo_destroy.py | 2 +- .../ticket/builders/mongodb/mongo_disable.py | 2 +- .../ticket/builders/mongodb/mongo_enable.py | 2 +- .../builders/mongodb/mongo_full_backup.py | 2 +- .../builders/mongodb/mongo_instance_reload.py | 2 +- .../builders/mongodb/mongo_reduce_mongos.py | 2 +- .../mongodb/mongo_reduce_shard_nodes.py | 2 +- .../mongodb/mongo_replicaset_apply.py | 2 +- .../ticket/builders/mongodb/mongo_restore.py | 2 +- .../builders/mongodb/mongo_scale_updown.py | 2 +- .../builders/mongodb/mongo_script_exec.py | 2 +- .../builders/mongodb/mongo_shard_apply.py | 2 +- .../mongodb/mongodb_temporary_destroy.py | 2 +- dbm-ui/backend/ticket/builders/mysql/base.py | 2 +- .../builders/mysql/mysql_authorize_rules.py | 2 +- .../ticket/builders/mysql/mysql_checksum.py | 2 +- .../builders/mysql/mysql_clone_rules.py | 2 +- .../builders/mysql/mysql_data_repair.py | 2 +- .../ticket/builders/mysql/mysql_ha_apply.py | 2 +- .../ticket/builders/mysql/mysql_ha_backup.py | 2 +- .../ticket/builders/mysql/mysql_ha_clear.py | 2 +- .../ticket/builders/mysql/mysql_ha_destroy.py | 2 +- .../ticket/builders/mysql/mysql_ha_disable.py | 2 +- .../ticket/builders/mysql/mysql_ha_enable.py | 2 +- .../builders/mysql/mysql_ha_full_backup.py | 2 +- .../mysql/mysql_ha_metadata_import.py | 2 +- .../ticket/builders/mysql/mysql_ha_rename.py | 2 +- .../builders/mysql/mysql_ha_standardize.py | 2 +- .../builders/mysql/mysql_import_sqlfile.py | 2 +- .../builders/mysql/mysql_master_fail_over.py | 2 +- .../builders/mysql/mysql_single_apply.py | 2 +- .../builders/mysql/mysql_single_destroy.py | 2 +- .../builders/mysql/mysql_single_disable.py | 2 +- .../builders/mysql/mysql_single_enable.py | 2 +- .../ticket/builders/pulsar/pulsar_apply.py | 2 +- .../ticket/builders/pulsar/pulsar_destroy.py | 2 +- .../ticket/builders/pulsar/pulsar_disable.py | 2 +- .../ticket/builders/pulsar/pulsar_enable.py | 2 +- .../ticket/builders/pulsar/pulsar_reboot.py | 2 +- .../ticket/builders/pulsar/pulsar_replace.py | 2 +- .../ticket/builders/pulsar/pulsar_scale_up.py | 2 +- .../ticket/builders/pulsar/pulsar_shrink.py | 2 +- dbm-ui/backend/ticket/builders/redis/base.py | 2 +- .../builders/redis/plugin_create_clb.py | 2 +- .../builders/redis/plugin_create_polaris.py | 2 +- .../builders/redis/plugin_delete_clb.py | 2 +- .../builders/redis/plugin_delete_polaris.py | 2 +- .../builders/redis/plugin_dns_bind_clb.py | 2 +- .../builders/redis/plugin_dns_unbind_clb.py | 2 +- .../ticket/builders/redis/redis_backup.py | 2 +- .../ticket/builders/redis/redis_close.py | 2 +- .../builders/redis/redis_cluster_apply.py | 2 +- .../ticket/builders/redis/redis_destroy.py | 2 +- .../ticket/builders/redis/redis_key_delete.py | 2 +- .../builders/redis/redis_key_extract.py | 2 +- .../ticket/builders/redis/redis_open.py | 2 +- .../ticket/builders/redis/redis_purge.py | 2 +- .../builders/redis/redis_toolbox_add_slave.py | 2 +- .../builders/redis/redis_toolbox_autofix.py | 2 +- .../builders/redis/redis_toolbox_cut_off.py | 2 +- .../redis/redis_toolbox_data_check_repair.py | 2 +- .../builders/redis/redis_toolbox_data_copy.py | 2 +- .../redis_toolbox_datastruct_task_delete.py | 2 +- .../redis/redis_toolbox_fixpoint_make.py | 2 +- .../redis/redis_toolbox_instance_shutdown.py | 2 +- .../redis_toolbox_master_slave_switch.py | 2 +- .../redis/redis_toolbox_proxy_scale_down.py | 2 +- .../redis/redis_toolbox_proxy_scale_up.py | 2 +- .../redis/redis_toolbox_redis_scale_updown.py | 2 +- .../redis/redis_toolbox_rollback_data_copy.py | 2 +- .../redis/redis_toolbox_shard_update.py | 2 +- .../redis/redis_toolbox_type_update.py | 2 +- .../ticket/builders/riak/riak_apply.py | 2 +- .../ticket/builders/riak/riak_destroy.py | 2 +- .../ticket/builders/riak/riak_disable.py | 2 +- .../ticket/builders/riak/riak_enable.py | 2 +- .../ticket/builders/riak/riak_migrate.py | 2 +- .../ticket/builders/riak/riak_reboot.py | 2 +- .../ticket/builders/riak/riak_scale_up.py | 2 +- .../ticket/builders/riak/riak_shrink.py | 2 +- .../ticket/builders/spider/metadata_import.py | 2 +- .../spider/mysql_spider_standardize.py | 2 +- .../builders/tbinlogdumper/dumper_apply.py | 2 +- .../builders/tbinlogdumper/dumper_disable.py | 2 +- .../builders/tbinlogdumper/dumper_enable.py | 2 +- .../tbinlogdumper/dumper_reduce_nodes.py | 2 +- .../builders/tbinlogdumper/dumper_switch.py | 2 +- .../tendbcluster/append_deploy_ctl.py | 2 +- .../ticket/builders/tendbcluster/base.py | 2 +- .../builders/tendbcluster/tendb_apply.py | 2 +- .../tendbcluster/tendb_authorize_rules.py | 2 +- .../builders/tendbcluster/tendb_clear.py | 2 +- .../tendbcluster/tendb_clone_rules.py | 2 +- .../tendbcluster/tendb_data_repair.py | 2 +- .../builders/tendbcluster/tendb_destroy.py | 2 +- .../builders/tendbcluster/tendb_disable.py | 2 +- .../builders/tendbcluster/tendb_enable.py | 2 +- .../tendbcluster/tendb_import_sqlfile.py | 2 +- .../builders/tendbcluster/tendb_rename.py | 2 +- .../tendbcluster/tendb_temporary_destroy.py | 2 +- dbm-ui/backend/ticket/constants.py | 2 +- dbm-ui/backend/ticket/exceptions.py | 2 +- dbm-ui/backend/ticket/handler.py | 2 +- dbm-ui/backend/ticket/mock_data.py | 2 +- dbm-ui/backend/ticket/models/ticket.py | 2 +- .../ticket/models/ticket_result_relation.py | 2 +- dbm-ui/backend/ticket/models/todo.py | 2 +- dbm-ui/backend/ticket/serializers.py | 2 +- dbm-ui/backend/ticket/tasks/__init__.py | 497 ++++++++++++++++++ dbm-ui/backend/ticket/tasks/ticket_tasks.py | 2 +- dbm-ui/backend/ticket/todos/__init__.py | 2 +- dbm-ui/backend/ticket/views.py | 2 +- dbm-ui/backend/utils/string.py | 4 +- dbm-ui/backend/utils/time.py | 2 +- dbm-ui/backend/version_log/config.py | 2 +- dbm-ui/backend/version_log/models.py | 2 +- dbm-ui/backend/version_log/views.py | 2 +- .../charts/db-remote-service/Chart.yaml | 2 +- .../templates/deployment.yaml | 31 +- .../charts/db-remote-service/values.yaml | 6 +- helm-charts/bk-dbm/values.yaml | 12 +- 969 files changed, 2099 insertions(+), 1145 deletions(-) create mode 100644 dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/__init__.py create mode 100644 dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/cluster_instances.py create mode 100644 dbm-ui/backend/db_meta/migrations/0036_auto_20240405_1608.py create mode 100644 dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/__init__.py create mode 100644 dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/query.py create mode 100644 dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/views.py create mode 100644 dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/yasg_slz.py rename dbm-ui/backend/env/{dev.py => db_extention.py} (70%) create mode 100644 dbm-ui/backend/tests/db_meta/api/cluster/base/__init__.py create mode 100644 dbm-ui/backend/tests/db_meta/api/cluster/base/test_handler.py rename dbm-ui/backend/tests/mock_data/components/{mysql_priv_manager.py => dbpriv_manager.py} (98%) create mode 100644 dbm-ui/backend/tests/mock_data/flow/__init__.py create mode 100644 dbm-ui/backend/tests/mock_data/flow/components/__init__.py create mode 100644 dbm-ui/backend/tests/mock_data/flow/components/collections/__init__.py create mode 100644 dbm-ui/backend/ticket/tasks/__init__.py diff --git a/dbm-services/mysql/db-priv/service/add_priv.go b/dbm-services/mysql/db-priv/service/add_priv.go index af330c6407..3160ad0e3f 100644 --- a/dbm-services/mysql/db-priv/service/add_priv.go +++ b/dbm-services/mysql/db-priv/service/add_priv.go @@ -100,7 +100,7 @@ func (m *PrivTaskPara) AddPriv(jsonPara string) error { AddErrorOnly(&errMsg, errors.New(failInfo+sep+err.Error())) return } - if m.ClusterType == tendbha || m.ClusterType == tendbsingle { + if m.ClusterType == tendbha || m.ClusterType == tendbsingle || m.ClusterType == MySQLOnK8S { // 当"cluster_type": "tendbha", "bind_to": "proxy" tendbha的主域名, "bind_to": "storage" tendbha的备域名 if instance.ClusterType == tendbha && instance.BindTo == machineTypeProxy { tendbhaMasterDomain = true @@ -121,6 +121,15 @@ func (m *PrivTaskPara) AddPriv(jsonPara string) error { errMsgInner = append(errMsgInner, err.Error()) } } + if instance.ClusterType == MySQLOnK8S { + // TODO 这里要记录集群的访问端口,因为容器化集群可能没有存储实例, + address = fmt.Sprintf("%s:%d", instance.ImmuteDomain, 3306) + err = ImportBackendPrivilege(account, accountRule, address, proxyIPs, m.SourceIPs, + instance.ClusterType, tendbhaMasterDomain, instance.BkCloudId, false) + if err != nil { + errMsgInner = append(errMsgInner, err.Error()) + } + } if len(errMsgInner) > 0 { AddErrorOnly(&errMsg, errors.New(failInfo+sep+strings.Join(errMsgInner, sep))) return diff --git a/dbm-services/mysql/db-priv/service/add_priv_base_func.go b/dbm-services/mysql/db-priv/service/add_priv_base_func.go index 96d2f6275b..40e65b6dc4 100644 --- a/dbm-services/mysql/db-priv/service/add_priv_base_func.go +++ b/dbm-services/mysql/db-priv/service/add_priv_base_func.go @@ -22,7 +22,7 @@ import ( func GetAccountRuleInfo(bkBizId int64, clusterType string, user, dbname string) (TbAccounts, TbAccountRules, error) { var account TbAccounts var accountRule TbAccountRules - if clusterType == tendbha || clusterType == tendbsingle { + if clusterType == tendbha || clusterType == tendbsingle || clusterType == MySQLOnK8S { clusterType = mysql } if clusterType == sqlserverHA || clusterType == sqlserverSingle { @@ -185,7 +185,7 @@ func GenerateBackendSQL(account TbAccounts, rule TbAccountRules, ips []string, m CreateUserVersion8 = fmt.Sprintf(`CREATE USER IF NOT EXISTS '%s'@'%s' %s;`, account.User, ip, fmt.Sprintf("IDENTIFIED WITH %s AS '%s'", pswResp.PwdType, pswResp.Psw)) } - if (clusterType == tendbha || clusterType == tendbsingle) && MySQLVersionParse(mysqlVersion, "") >= + if (clusterType == tendbha || clusterType == tendbsingle || clusterType == MySQLOnK8S) && MySQLVersionParse(mysqlVersion, "") >= MySQLVersionParse("8.0.0", "") { sqlTemp = append(sqlTemp, CreateUserVersion8) identifiedByPassword = "" @@ -295,7 +295,7 @@ func GetPassword(user string, multiPsw MultiPsw, mysqlVersion, ip string, addres var tipsForProxyIP string if (MySQLVersionParse(mysqlVersion, "") > MySQLVersionParse("5.7.5", "")) && - (clusterType == tendbha || clusterType == tendbsingle) { + (clusterType == tendbha || clusterType == tendbsingle || clusterType == MySQLOnK8S) { passwdColName = "authentication_string" } diff --git a/dbm-services/mysql/db-priv/service/admin_password.go b/dbm-services/mysql/db-priv/service/admin_password.go index f322fe88fb..27b347d994 100644 --- a/dbm-services/mysql/db-priv/service/admin_password.go +++ b/dbm-services/mysql/db-priv/service/admin_password.go @@ -452,7 +452,7 @@ func (m *ModifyAdminUserPasswordPara) ModifyAdminPasswordForMysql( notOK := InstanceList{instanceList.Role, []IpPort{}} role := instanceList.Role if *cluster.ClusterType == tendbcluster && role == machineTypeSpider { - base = append(base, flushPriv, setBinlogOff, setDdlByCtlOFF) + base = append(base, flushPriv, setBinlogOff) } else if *cluster.ClusterType == tendbcluster && role == tdbctl { base = append(base, flushPriv, setBinlogOff, setTcAdminOFF) } else { diff --git a/dbm-services/mysql/db-priv/service/db_meta_service.go b/dbm-services/mysql/db-priv/service/db_meta_service.go index ea3b83d7f1..6c163b3a47 100644 --- a/dbm-services/mysql/db-priv/service/db_meta_service.go +++ b/dbm-services/mysql/db-priv/service/db_meta_service.go @@ -14,6 +14,7 @@ const mysql string = "mysql" // 包含tendbha和tendbsingle const tendbha string = "tendbha" const tendbsingle string = "tendbsingle" const tendbcluster string = "tendbcluster" +const MySQLOnK8S string = "MySQLOnK8S" const machineTypeBackend string = "backend" const machineTypeSingle string = "single" const machineTypeRemote string = "remote" diff --git a/dbm-ui/backend/bk_web/handlers.py b/dbm-ui/backend/bk_web/handlers.py index ba9e89ecc3..7a33e1c2c1 100644 --- a/dbm-ui/backend/bk_web/handlers.py +++ b/dbm-ui/backend/bk_web/handlers.py @@ -14,7 +14,7 @@ from django.conf import settings from django.http import Http404, JsonResponse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import exceptions, status from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/bk_web/models.py b/dbm-ui/backend/bk_web/models.py index f1155f5e59..fa586d4710 100644 --- a/dbm-ui/backend/bk_web/models.py +++ b/dbm-ui/backend/bk_web/models.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_NORMAL diff --git a/dbm-ui/backend/components/base.py b/dbm-ui/backend/components/base.py index 58d6924109..db22b45168 100644 --- a/dbm-ui/backend/components/base.py +++ b/dbm-ui/backend/components/base.py @@ -20,7 +20,7 @@ from django.conf import settings from django.core.cache import cache from django.utils import translation -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from urllib3.exceptions import ConnectTimeoutError from backend import env diff --git a/dbm-ui/backend/components/bk.py b/dbm-ui/backend/components/bk.py index 8fc69c49c9..639a727a3d 100644 --- a/dbm-ui/backend/components/bk.py +++ b/dbm-ui/backend/components/bk.py @@ -12,7 +12,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from requests import PreparedRequest from requests.auth import AuthBase diff --git a/dbm-ui/backend/components/bklog/client.py b/dbm-ui/backend/components/bklog/client.py index 798ba5d7de..e431e97765 100644 --- a/dbm-ui/backend/components/bklog/client.py +++ b/dbm-ui/backend/components/bklog/client.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import BKLOG_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/bkmonitorv3/client.py b/dbm-ui/backend/components/bkmonitorv3/client.py index f90e4eb6ec..b09135d682 100644 --- a/dbm-ui/backend/components/bkmonitorv3/client.py +++ b/dbm-ui/backend/components/bkmonitorv3/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import BKMONITORV3_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/bknodeman/client.py b/dbm-ui/backend/components/bknodeman/client.py index 083be60068..655b19c77a 100644 --- a/dbm-ui/backend/components/bknodeman/client.py +++ b/dbm-ui/backend/components/bknodeman/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import BKNODEMAN_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/cc/client.py b/dbm-ui/backend/components/cc/client.py index a46f86b821..8aba6f242a 100644 --- a/dbm-ui/backend/components/cc/client.py +++ b/dbm-ui/backend/components/cc/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import CC_APIGW_DOMAIN @@ -24,7 +24,7 @@ class ErrorCode: HOST_NOT_BELONG_MODULE = 1110056 CUSTOM_FIELD_ALREADY_EXISTS = 1101107 - def __init__(self): + def __init__(self, *args, **kwargs): self.list_hosts_without_biz = self.generate_data_api( method="POST", url="list_hosts_without_biz/", diff --git a/dbm-ui/backend/components/celery_service/client.py b/dbm-ui/backend/components/celery_service/client.py index 6678949c3e..bb17e65ea1 100644 --- a/dbm-ui/backend/components/celery_service/client.py +++ b/dbm-ui/backend/components/celery_service/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import CELERY_SERVICE_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/cmsi/client.py b/dbm-ui/backend/components/cmsi/client.py index 60fde99066..1df0c255d2 100644 --- a/dbm-ui/backend/components/cmsi/client.py +++ b/dbm-ui/backend/components/cmsi/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/components/db_name_service/client.py b/dbm-ui/backend/components/db_name_service/client.py index e62c957a26..43f574d699 100644 --- a/dbm-ui/backend/components/db_name_service/client.py +++ b/dbm-ui/backend/components/db_name_service/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import NAMESERVICE_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/db_remote_service/client.py b/dbm-ui/backend/components/db_remote_service/client.py index 115a96787c..b7541c3974 100644 --- a/dbm-ui/backend/components/db_remote_service/client.py +++ b/dbm-ui/backend/components/db_remote_service/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env diff --git a/dbm-ui/backend/components/dbconfig/client.py b/dbm-ui/backend/components/dbconfig/client.py index 143f593303..4669ade00b 100644 --- a/dbm-ui/backend/components/dbconfig/client.py +++ b/dbm-ui/backend/components/dbconfig/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import DBCONFIG_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/dbresource/client.py b/dbm-ui/backend/components/dbresource/client.py index 80864af592..2fe802bd28 100644 --- a/dbm-ui/backend/components/dbresource/client.py +++ b/dbm-ui/backend/components/dbresource/client.py @@ -9,7 +9,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import DBRESOURCE_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/dns/client.py b/dbm-ui/backend/components/dns/client.py index 388ac62fbc..c6e5451384 100644 --- a/dbm-ui/backend/components/dns/client.py +++ b/dbm-ui/backend/components/dns/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import DNS_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/gcs/client.py b/dbm-ui/backend/components/gcs/client.py index 027c563a46..f8c441e4dc 100644 --- a/dbm-ui/backend/components/gcs/client.py +++ b/dbm-ui/backend/components/gcs/client.py @@ -9,7 +9,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import GCS_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/gse/client.py b/dbm-ui/backend/components/gse/client.py index e871520a91..b4685c8164 100644 --- a/dbm-ui/backend/components/gse/client.py +++ b/dbm-ui/backend/components/gse/client.py @@ -9,7 +9,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import GSE_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/hadb/client.py b/dbm-ui/backend/components/hadb/client.py index d6e7fd1d21..34d5f810c1 100644 --- a/dbm-ui/backend/components/hadb/client.py +++ b/dbm-ui/backend/components/hadb/client.py @@ -9,7 +9,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import HADB_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/itsm/client.py b/dbm-ui/backend/components/itsm/client.py index ca02edbcd6..e79a886d08 100644 --- a/dbm-ui/backend/components/itsm/client.py +++ b/dbm-ui/backend/components/itsm/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import ITSM_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/job/client.py b/dbm-ui/backend/components/job/client.py index e2459625a5..ac586532ba 100644 --- a/dbm-ui/backend/components/job/client.py +++ b/dbm-ui/backend/components/job/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import JOB_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/mysql_backup/client.py b/dbm-ui/backend/components/mysql_backup/client.py index c2eacefb14..8422973276 100644 --- a/dbm-ui/backend/components/mysql_backup/client.py +++ b/dbm-ui/backend/components/mysql_backup/client.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import BACKUP_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/mysql_partition/client.py b/dbm-ui/backend/components/mysql_partition/client.py index 2221ee8076..8a2309bfc6 100644 --- a/dbm-ui/backend/components/mysql_partition/client.py +++ b/dbm-ui/backend/components/mysql_partition/client.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import PARTITION_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/mysql_priv_manager/client.py b/dbm-ui/backend/components/mysql_priv_manager/client.py index 27ca3ae1fa..1e5038da07 100644 --- a/dbm-ui/backend/components/mysql_priv_manager/client.py +++ b/dbm-ui/backend/components/mysql_priv_manager/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import MYSQL_PRIV_MANAGER_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/proxy_api.py b/dbm-ui/backend/components/proxy_api.py index 6c2446e5fe..4dbc43c228 100644 --- a/dbm-ui/backend/components/proxy_api.py +++ b/dbm-ui/backend/components/proxy_api.py @@ -11,10 +11,10 @@ from django.utils.translation import gettext as _ -from backend import env from backend.components.base import DataAPI from backend.components.exception import DataAPIException from backend.db_proxy.models import DBCloudProxy +from backend.db_services.ipchooser.constants import DEFAULT_CLOUD class ProxyAPI(DataAPI): @@ -23,19 +23,17 @@ class ProxyAPI(DataAPI): """ def build_actual_url(self, param): - url = super().build_actual_url(param) - - # 如果配置了DOMAIN_SKIP_PROXY,表示跳过proxy代理 - if env.DOMAIN_SKIP_PROXY: - return url - try: bk_cloud_id = param["bk_cloud_id"] except KeyError: raise DataAPIException(_("ProxyApi 必须传入 bk_cloud_id 参数")) + url = super().build_actual_url(param) # 只取最新的nginx作为转发服务 proxy = DBCloudProxy.objects.filter(bk_cloud_id=bk_cloud_id).last() + # 直连区域未部署代理时,直接返回原地址(用于一般容器化环境或本地开发) + if not proxy and bk_cloud_id == DEFAULT_CLOUD: + return url host = "https://" if self.ssl else "http://" external_address = f"{host}{proxy.external_address}" return url.replace(self.base.rstrip("/"), external_address) diff --git a/dbm-ui/backend/components/scr/client.py b/dbm-ui/backend/components/scr/client.py index 869d3c891f..604d486cc1 100644 --- a/dbm-ui/backend/components/scr/client.py +++ b/dbm-ui/backend/components/scr/client.py @@ -9,7 +9,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import SCR_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/sops/client.py b/dbm-ui/backend/components/sops/client.py index e88268b794..78d6bca38f 100644 --- a/dbm-ui/backend/components/sops/client.py +++ b/dbm-ui/backend/components/sops/client.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import SOPS_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/sql_import/client.py b/dbm-ui/backend/components/sql_import/client.py index f6552b4986..c426f76742 100644 --- a/dbm-ui/backend/components/sql_import/client.py +++ b/dbm-ui/backend/components/sql_import/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import MYSQL_SIMULATION_DOMAIN diff --git a/dbm-ui/backend/components/usermanage/client.py b/dbm-ui/backend/components/usermanage/client.py index 1a19b93f05..ced4169e1a 100644 --- a/dbm-ui/backend/components/usermanage/client.py +++ b/dbm-ui/backend/components/usermanage/client.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..base import BaseApi from ..domains import USER_MANAGE_APIGW_DOMAIN diff --git a/dbm-ui/backend/components/utils/handlers.py b/dbm-ui/backend/components/utils/handlers.py index 6ef5cb125d..1dd0341847 100644 --- a/dbm-ui/backend/components/utils/handlers.py +++ b/dbm-ui/backend/components/utils/handlers.py @@ -10,7 +10,7 @@ """ from typing import Any, Dict, List, Union -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.components.exception import DataAPIException diff --git a/dbm-ui/backend/configuration/apps.py b/dbm-ui/backend/configuration/apps.py index c652e2ae49..9f0aaed7d3 100644 --- a/dbm-ui/backend/configuration/apps.py +++ b/dbm-ui/backend/configuration/apps.py @@ -13,7 +13,7 @@ from django.apps import AppConfig from django.db.models.signals import post_migrate -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ logger = logging.getLogger("root") diff --git a/dbm-ui/backend/configuration/constants.py b/dbm-ui/backend/configuration/constants.py index f6e81e61d6..0ed7afa045 100644 --- a/dbm-ui/backend/configuration/constants.py +++ b/dbm-ui/backend/configuration/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/configuration/exceptions.py b/dbm-ui/backend/configuration/exceptions.py index a4ab89133a..c4143c6d99 100644 --- a/dbm-ui/backend/configuration/exceptions.py +++ b/dbm-ui/backend/configuration/exceptions.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/configuration/handlers/password.py b/dbm-ui/backend/configuration/handlers/password.py index 4138f4d592..1350accf0d 100644 --- a/dbm-ui/backend/configuration/handlers/password.py +++ b/dbm-ui/backend/configuration/handlers/password.py @@ -11,7 +11,7 @@ from collections import defaultdict from typing import Any, Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django_celery_beat.schedulers import ModelEntry from backend.components import DBPrivManagerApi diff --git a/dbm-ui/backend/configuration/models/dba.py b/dbm-ui/backend/configuration/models/dba.py index c9f9cba151..0076ba30e7 100644 --- a/dbm-ui/backend/configuration/models/dba.py +++ b/dbm-ui/backend/configuration/models/dba.py @@ -11,7 +11,7 @@ from typing import Dict, List, Union from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_SHORT from backend.configuration.constants import DEFAULT_DB_ADMINISTRATORS, PLAT_BIZ_ID, DBType diff --git a/dbm-ui/backend/configuration/models/function_controller.py b/dbm-ui/backend/configuration/models/function_controller.py index 1c7ac49603..a6b6684759 100644 --- a/dbm-ui/backend/configuration/models/function_controller.py +++ b/dbm-ui/backend/configuration/models/function_controller.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/configuration/models/ip_whitelist.py b/dbm-ui/backend/configuration/models/ip_whitelist.py index a424ef21e7..dcff724bbc 100644 --- a/dbm-ui/backend/configuration/models/ip_whitelist.py +++ b/dbm-ui/backend/configuration/models/ip_whitelist.py @@ -14,7 +14,7 @@ from django.db import models from django.db.models import Q from django.forms.models import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_LONG from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/configuration/models/password_policy.py b/dbm-ui/backend/configuration/models/password_policy.py index 1474e4f2b2..60080595d5 100644 --- a/dbm-ui/backend/configuration/models/password_policy.py +++ b/dbm-ui/backend/configuration/models/password_policy.py @@ -12,7 +12,7 @@ from typing import Optional from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_SHORT from backend.configuration.constants import INIT_PASSWORD_POLICY diff --git a/dbm-ui/backend/configuration/models/profile.py b/dbm-ui/backend/configuration/models/profile.py index 094405d1a1..1bf5c61632 100644 --- a/dbm-ui/backend/configuration/models/profile.py +++ b/dbm-ui/backend/configuration/models/profile.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_MIDDLE, LEN_SHORT diff --git a/dbm-ui/backend/configuration/models/system.py b/dbm-ui/backend/configuration/models/system.py index 95043f3928..6b2802402c 100644 --- a/dbm-ui/backend/configuration/models/system.py +++ b/dbm-ui/backend/configuration/models/system.py @@ -13,7 +13,7 @@ from django.conf import settings from django.db import connection, models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.bk_web.constants import LEN_LONG, LEN_NORMAL diff --git a/dbm-ui/backend/configuration/serializers.py b/dbm-ui/backend/configuration/serializers.py index c6c797c92c..7897d94872 100644 --- a/dbm-ui/backend/configuration/serializers.py +++ b/dbm-ui/backend/configuration/serializers.py @@ -10,7 +10,7 @@ """ import re -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.bk_web.constants import LEN_NORMAL, LEN_SHORT diff --git a/dbm-ui/backend/configuration/tasks/password.py b/dbm-ui/backend/configuration/tasks/password.py index 98eccc2b9d..62e37c7592 100644 --- a/dbm-ui/backend/configuration/tasks/password.py +++ b/dbm-ui/backend/configuration/tasks/password.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBPrivManagerApi from backend.configuration.constants import DB_ADMIN_USER_MAP, DBM_PASSWORD_SECURITY_NAME, AdminPasswordRole, DBType diff --git a/dbm-ui/backend/configuration/views/dba.py b/dbm-ui/backend/configuration/views/dba.py index 03f4539857..6cc94bdfbd 100644 --- a/dbm-ui/backend/configuration/views/dba.py +++ b/dbm-ui/backend/configuration/views/dba.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/configuration/views/function_controller.py b/dbm-ui/backend/configuration/views/function_controller.py index 2c973816ac..b58d563ecd 100644 --- a/dbm-ui/backend/configuration/views/function_controller.py +++ b/dbm-ui/backend/configuration/views/function_controller.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.response import Response diff --git a/dbm-ui/backend/configuration/views/ip_whitelist.py b/dbm-ui/backend/configuration/views/ip_whitelist.py index 3de5321010..427884813e 100644 --- a/dbm-ui/backend/configuration/views/ip_whitelist.py +++ b/dbm-ui/backend/configuration/views/ip_whitelist.py @@ -10,7 +10,7 @@ """ from functools import wraps -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/configuration/views/password_policy.py b/dbm-ui/backend/configuration/views/password_policy.py index c2ce975077..03d67448af 100644 --- a/dbm-ui/backend/configuration/views/password_policy.py +++ b/dbm-ui/backend/configuration/views/password_policy.py @@ -12,7 +12,7 @@ import json from celery.schedules import crontab -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/configuration/views/profile.py b/dbm-ui/backend/configuration/views/profile.py index a75f4d312b..e04f602902 100644 --- a/dbm-ui/backend/configuration/views/profile.py +++ b/dbm-ui/backend/configuration/views/profile.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/configuration/views/system.py b/dbm-ui/backend/configuration/views/system.py index a2d3e59177..76bbe70c19 100644 --- a/dbm-ui/backend/configuration/views/system.py +++ b/dbm-ui/backend/configuration/views/system.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/core/encrypt/exceptions.py b/dbm-ui/backend/core/encrypt/exceptions.py index 72339b7aa7..d1b2c702d0 100644 --- a/dbm-ui/backend/core/encrypt/exceptions.py +++ b/dbm-ui/backend/core/encrypt/exceptions.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..exceptions import CoreBaseException diff --git a/dbm-ui/backend/core/encrypt/models.py b/dbm-ui/backend/core/encrypt/models.py index 8ad46cc88c..81b214e0f3 100644 --- a/dbm-ui/backend/core/encrypt/models.py +++ b/dbm-ui/backend/core/encrypt/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.core.encrypt.constants import AsymmetricCipherConfigType, AsymmetricCipherKeyType, AsymmetricCipherType diff --git a/dbm-ui/backend/core/encrypt/serializers.py b/dbm-ui/backend/core/encrypt/serializers.py index 5095d73025..293c1bd3d7 100644 --- a/dbm-ui/backend/core/encrypt/serializers.py +++ b/dbm-ui/backend/core/encrypt/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.core.encrypt.constants import AsymmetricCipherConfigType diff --git a/dbm-ui/backend/core/encrypt/views.py b/dbm-ui/backend/core/encrypt/views.py index 5421e4a07e..1ff2fed0eb 100644 --- a/dbm-ui/backend/core/encrypt/views.py +++ b/dbm-ui/backend/core/encrypt/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/core/storages/base.py b/dbm-ui/backend/core/storages/base.py index a897d1f635..4617144001 100644 --- a/dbm-ui/backend/core/storages/base.py +++ b/dbm-ui/backend/core/storages/base.py @@ -18,7 +18,7 @@ from django.core.exceptions import SuspiciousFileOperation from django.core.files.storage import Storage from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.components import JobApi diff --git a/dbm-ui/backend/core/storages/constants.py b/dbm-ui/backend/core/storages/constants.py index 1a312ca997..a331433e4f 100644 --- a/dbm-ui/backend/core/storages/constants.py +++ b/dbm-ui/backend/core/storages/constants.py @@ -11,7 +11,7 @@ from enum import Enum from typing import Any, Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.utils.cache import class_member_cache from blue_krill.data_types.enum import EnumField, StructuredEnum @@ -20,7 +20,7 @@ class CosBucketEnum(StructuredEnum): """对象存储仓库枚举""" - # TODO 这里如果加 ugettext_lazy 会有 AppRegistryNotReady 异常,怀疑是 StructuredEnum 的问题,待解决 + # TODO 这里如果加 gettext_lazy 会有 AppRegistryNotReady 异常,怀疑是 StructuredEnum 的问题,待解决 PUBLIC = EnumField("public", _("公开仓库")) PRIVATE = EnumField("private", _("私有仓库")) diff --git a/dbm-ui/backend/core/storages/exceptions.py b/dbm-ui/backend/core/storages/exceptions.py index 046aece13f..2ae6283c79 100644 --- a/dbm-ui/backend/core/storages/exceptions.py +++ b/dbm-ui/backend/core/storages/exceptions.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..exceptions import CoreBaseException diff --git a/dbm-ui/backend/core/storages/file_source.py b/dbm-ui/backend/core/storages/file_source.py index 8ec7442fd7..996eb2384b 100644 --- a/dbm-ui/backend/core/storages/file_source.py +++ b/dbm-ui/backend/core/storages/file_source.py @@ -11,7 +11,7 @@ from typing import Any, Dict, Optional -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.components import JobApi from backend.utils.md5 import count_md5 diff --git a/dbm-ui/backend/core/storages/models.py b/dbm-ui/backend/core/storages/models.py index 4aa8f27c4c..924da9c51f 100644 --- a/dbm-ui/backend/core/storages/models.py +++ b/dbm-ui/backend/core/storages/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.utils.cache import class_member_cache diff --git a/dbm-ui/backend/core/storages/serializers.py b/dbm-ui/backend/core/storages/serializers.py index 93b3b0bcfa..e20d8eaf86 100644 --- a/dbm-ui/backend/core/storages/serializers.py +++ b/dbm-ui/backend/core/storages/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers diff --git a/dbm-ui/backend/core/storages/views.py b/dbm-ui/backend/core/storages/views.py index 90ae421a53..cea2aff12f 100644 --- a/dbm-ui/backend/core/storages/views.py +++ b/dbm-ui/backend/core/storages/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/core/translation/exceptions.py b/dbm-ui/backend/core/translation/exceptions.py index 510bb83a53..85ee4756a7 100644 --- a/dbm-ui/backend/core/translation/exceptions.py +++ b/dbm-ui/backend/core/translation/exceptions.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ..exceptions import CoreBaseException diff --git a/dbm-ui/backend/core/translation/language_finder.py b/dbm-ui/backend/core/translation/language_finder.py index 3b8d9f585b..e3c96e8e1d 100644 --- a/dbm-ui/backend/core/translation/language_finder.py +++ b/dbm-ui/backend/core/translation/language_finder.py @@ -225,7 +225,7 @@ def visit_Module(self, node): node.body.insert( 0, ast.ImportFrom( - module=NodeTranslateInit.ImportPath, names=[ast.alias(name="ugettext", asname="_")], level=0 + module=NodeTranslateInit.ImportPath, names=[ast.alias(name="gettext", asname="_")], level=0 ), ) return node @@ -388,9 +388,9 @@ def run(self): f'{quote}{sentence["key"]}{quote}', f'_({quote}{sentence["key"]}{quote})' ) - # 导入翻译函数包, 默认为ugettext, TODO: 做成一个参数传递? + # 导入翻译函数包, 默认为gettext, TODO: 做成一个参数传递? if getattr(translate_nodes, "language_flag", False): - file_lines.insert(1, f"from {NodeTranslateInit.ImportPath} import ugettext as _\n") + file_lines.insert(1, f"from {NodeTranslateInit.ImportPath} import gettext as _\n") with open(each_file, "w") as f: f.write("".join(file_lines)) diff --git a/dbm-ui/backend/db_dirty/constants.py b/dbm-ui/backend/db_dirty/constants.py index 339366e28c..73efc3db54 100644 --- a/dbm-ui/backend/db_dirty/constants.py +++ b/dbm-ui/backend/db_dirty/constants.py @@ -9,6 +9,6 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ SWAGGER_TAG = _("污点池") diff --git a/dbm-ui/backend/db_dirty/filters.py b/dbm-ui/backend/db_dirty/filters.py index a5aa709bed..8934d6ca5a 100644 --- a/dbm-ui/backend/db_dirty/filters.py +++ b/dbm-ui/backend/db_dirty/filters.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters import rest_framework as filters from backend.db_dirty.models import DirtyMachine diff --git a/dbm-ui/backend/db_dirty/handlers.py b/dbm-ui/backend/db_dirty/handlers.py index 0f90bdcb30..ec2b880ce4 100644 --- a/dbm-ui/backend/db_dirty/handlers.py +++ b/dbm-ui/backend/db_dirty/handlers.py @@ -12,7 +12,7 @@ from collections import defaultdict from typing import Any, Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import CCApi diff --git a/dbm-ui/backend/db_dirty/models.py b/dbm-ui/backend/db_dirty/models.py index 4d94d0d217..f649dc3e5d 100644 --- a/dbm-ui/backend/db_dirty/models.py +++ b/dbm-ui/backend/db_dirty/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_MIDDLE from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_dirty/serializers.py b/dbm-ui/backend/db_dirty/serializers.py index 6d9bcab601..96a705f91c 100644 --- a/dbm-ui/backend/db_dirty/serializers.py +++ b/dbm-ui/backend/db_dirty/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_dirty.mock import DIRTY_MACHINE_LIST diff --git a/dbm-ui/backend/db_dirty/views.py b/dbm-ui/backend/db_dirty/views.py index fb733bbc8b..d2a6c7f029 100644 --- a/dbm-ui/backend/db_dirty/views.py +++ b/dbm-ui/backend/db_dirty/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters import rest_framework from rest_framework import status from rest_framework.decorators import action diff --git a/dbm-ui/backend/db_event/views/dbha.py b/dbm-ui/backend/db_event/views/dbha.py index b3c0363c5c..4728a9ad10 100644 --- a/dbm-ui/backend/db_event/views/dbha.py +++ b/dbm-ui/backend/db_event/views/dbha.py @@ -10,7 +10,7 @@ """ from datetime import datetime -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_meta/api/cluster/base/handler.py b/dbm-ui/backend/db_meta/api/cluster/base/handler.py index 805320a362..2cc6620a1b 100644 --- a/dbm-ui/backend/db_meta/api/cluster/base/handler.py +++ b/dbm-ui/backend/db_meta/api/cluster/base/handler.py @@ -10,10 +10,17 @@ """ from abc import ABC +import pymysql from django.db import transaction +from backend import env +from backend.components import DBConfigApi, DBPrivManagerApi +from backend.components.dbconfig.constants import LevelName, OpType, ReqType +from backend.constants import DEFAULT_BK_CLOUD_ID +from backend.db_meta.enums import ClusterType from backend.db_meta.exceptions import ClusterNotExistException -from backend.db_meta.models import Cluster +from backend.db_meta.models import Cluster, ClusterEntry, ProxyInstance, StorageInstance +from backend.utils.string import base64_encode class ClusterHandler(ABC): @@ -44,6 +51,110 @@ def create(cls, *args, **kwargs): """「必须」创建集群""" raise NotImplementedError + @classmethod + @transaction.atomic + def import_meta(cls, details): + """「必须」导入元数据""" + # [*必须] 导入集群数据 + cluster_info = details["cluster_info"] + cluster_obj = Cluster.objects.create(**cluster_info) + for cluster_entry in details.get("cluster_entries", []): + ClusterEntry.objects.create( + cluster=cluster_obj, + # 默认导入的访问入口都是 DNS + cluster_entry_type=cluster_entry["cluster_entry_type"], + access_port=cluster_entry["access_port"], + entry=cluster_entry["entry"], + creator=cluster_obj.creator, + ) + + # [可选] 导入实例数据 + storage_instances = details.get("storage_instances", []) + storage_instance_objs = [StorageInstance(**storage_instance) for storage_instance in storage_instances] + StorageInstance.objects.bulk_create(storage_instance_objs, batch_size=100) + proxy_instances = details.get("proxy_instances", []) + proxy_instance_objs = [ProxyInstance(**proxy_instance) for proxy_instance in proxy_instances] + ProxyInstance.objects.bulk_create(proxy_instance_objs, batch_size=100) + + # [可选] 关联存储实例元组对 + + # [可选] 实例化集群配置(dbconfig) + db_configs = details.get("db_configs", []) + for db_config in db_configs: + conf_items = [ + {"conf_name": conf_name, "conf_value": conf_value, "op_type": OpType.UPDATE} + for conf_name, conf_value in db_config["config_map"].items() + ] + + DBConfigApi.upsert_conf_item( + { + "conf_file_info": { + "conf_file": db_config["conf_file"], + "conf_type": db_config["conf_type"], + "namespace": db_config["namespace"], + }, + "conf_items": conf_items, + "bk_biz_id": cluster_obj.bk_biz_id, + "level_name": LevelName.CLUSTER.value, + "level_value": cluster_obj.immute_domain, + "confirm": 0, + "req_type": ReqType.SAVE_AND_PUBLISH, + } + ) + + # [可选] 导入账号信息(dbpriv) + account = details.get("account") + if account: + DBPrivManagerApi.modify_password( + params={ + "instances": [ + { + "ip": instance.get("domain") or instance.get("ip"), + "port": instance.get("port", cluster_info.get("access_port")), + "bk_cloud_id": instance.get("bk_cloud_id", DEFAULT_BK_CLOUD_ID), + } + for instance in account["instances"] + ], + "password": base64_encode(account["password"]), + "username": account["username"], + "component": account["component"], + "operator": account.get("operator"), + } + ) + # 对 mysql 进行授权,添加 drs 超级账号,TODO:放到子类实现 + if cluster_obj.cluster_type == ClusterType.MySQLOnK8S: + + # 数据库连接配置 + db_config = { + "host": cluster_obj.immute_domain, + "user": account["username"], + "password": account["password"], + "database": "mysql", + } + + # SQL 语句,创建用户并授权 + create_user = "CREATE USER IF NOT EXISTS %s@%s IDENTIFIED WITH mysql_native_password BY %s ;" + grant_statement = "GRANT ALL PRIVILEGES ON *.* TO %s@%s WITH GRANT OPTION ;" + + # 连接到MySQL + connection = pymysql.connect(**db_config) + + try: + with connection.cursor() as cursor: + for host in env.DEFAULT_CLOUD_DRS_ACCESS_HOSTS: + # 执行语句 + cursor.execute(create_user, (env.DRS_USERNAME, host, env.DRS_PASSWORD)) + cursor.execute(grant_statement, (env.DRS_USERNAME, host)) + # 提交更改 + connection.commit() + finally: + # 关闭连接 + connection.close() + + # [可选] CMDB 标准化,使得能自动下发监控/日志采集配置 + + # [可选] 集群实例标准化 + @transaction.atomic def decommission(self): """「必须」下架集群""" diff --git a/dbm-ui/backend/db_meta/api/cluster/hdfs/create.py b/dbm-ui/backend/db_meta/api/cluster/hdfs/create.py index 2c50050ebf..d89042b084 100644 --- a/dbm-ui/backend/db_meta/api/cluster/hdfs/create.py +++ b/dbm-ui/backend/db_meta/api/cluster/hdfs/create.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/hdfs/destroy.py b/dbm-ui/backend/db_meta/api/cluster/hdfs/destroy.py index dfa493febe..af97b4c2c1 100644 --- a/dbm-ui/backend/db_meta/api/cluster/hdfs/destroy.py +++ b/dbm-ui/backend/db_meta/api/cluster/hdfs/destroy.py @@ -11,7 +11,7 @@ import logging from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster, ClusterEntry diff --git a/dbm-ui/backend/db_meta/api/cluster/influxdb/destroy.py b/dbm-ui/backend/db_meta/api/cluster/influxdb/destroy.py index 0b6712368d..846939dcac 100644 --- a/dbm-ui/backend/db_meta/api/cluster/influxdb/destroy.py +++ b/dbm-ui/backend/db_meta/api/cluster/influxdb/destroy.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_meta/api/cluster/influxdb/replace.py b/dbm-ui/backend/db_meta/api/cluster/influxdb/replace.py index 52f61e2dda..8fa13bc01e 100644 --- a/dbm-ui/backend/db_meta/api/cluster/influxdb/replace.py +++ b/dbm-ui/backend/db_meta/api/cluster/influxdb/replace.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta import request_validator diff --git a/dbm-ui/backend/db_meta/api/cluster/kafka/create.py b/dbm-ui/backend/db_meta/api/cluster/kafka/create.py index 93c5a60e00..e2d18470d0 100644 --- a/dbm-ui/backend/db_meta/api/cluster/kafka/create.py +++ b/dbm-ui/backend/db_meta/api/cluster/kafka/create.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/kafka/destroy.py b/dbm-ui/backend/db_meta/api/cluster/kafka/destroy.py index b8d4940ca1..52ec8c9a29 100644 --- a/dbm-ui/backend/db_meta/api/cluster/kafka/destroy.py +++ b/dbm-ui/backend/db_meta/api/cluster/kafka/destroy.py @@ -11,7 +11,7 @@ import logging from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster, ClusterEntry diff --git a/dbm-ui/backend/db_meta/api/cluster/kafka/replace.py b/dbm-ui/backend/db_meta/api/cluster/kafka/replace.py index de3642682c..63e28e1328 100644 --- a/dbm-ui/backend/db_meta/api/cluster/kafka/replace.py +++ b/dbm-ui/backend/db_meta/api/cluster/kafka/replace.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta import request_validator diff --git a/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/create_cluster.py index ec9e76f1d0..97c05b243a 100644 --- a/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/create_cluster.py @@ -14,7 +14,7 @@ from django.db import IntegrityError, transaction from django.db.models import QuerySet -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import DEFAULT_BK_CLOUD_ID from backend.db_meta import request_validator diff --git a/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/decommission.py b/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/decommission.py index 3e4e654a9a..02ed277f37 100644 --- a/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/decommission.py +++ b/dbm-ui/backend/db_meta/api/cluster/nosqlcomm/decommission.py @@ -14,7 +14,7 @@ from typing import Dict, List from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.api import common from backend.db_meta.enums import AccessLayer, ClusterType, InstanceStatus diff --git a/dbm-ui/backend/db_meta/api/cluster/rediscluster/create.py b/dbm-ui/backend/db_meta/api/cluster/rediscluster/create.py index 29f810658d..7eabe2103b 100644 --- a/dbm-ui/backend/db_meta/api/cluster/rediscluster/create.py +++ b/dbm-ui/backend/db_meta/api/cluster/rediscluster/create.py @@ -13,7 +13,7 @@ from typing import List, Optional from django.db import IntegrityError, transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import DEFAULT_BK_CLOUD_ID from backend.db_meta import request_validator diff --git a/dbm-ui/backend/db_meta/api/cluster/riak/create.py b/dbm-ui/backend/db_meta/api/cluster/riak/create.py index c45c271eb1..73688e1006 100644 --- a/dbm-ui/backend/db_meta/api/cluster/riak/create.py +++ b/dbm-ui/backend/db_meta/api/cluster/riak/create.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/sqlserverha/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/sqlserverha/create_cluster.py index 723f256f1a..cc26507121 100644 --- a/dbm-ui/backend/db_meta/api/cluster/sqlserverha/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/sqlserverha/create_cluster.py @@ -11,7 +11,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/sqlserversingle/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/sqlserversingle/create_cluster.py index 49dfdf4e08..54a6cfd56e 100644 --- a/dbm-ui/backend/db_meta/api/cluster/sqlserversingle/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/sqlserversingle/create_cluster.py @@ -12,7 +12,7 @@ from typing import Dict from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_cluster.py index e3ab5996dd..f5e085b4f4 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_cluster.py @@ -11,7 +11,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_slave_cluster.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_slave_cluster.py index 8620f5edac..ee178096c4 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_slave_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/create_slave_cluster.py @@ -9,7 +9,7 @@ """ from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryType from backend.db_meta.exceptions import DBMetaException diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py index 632021d947..49c72c1b77 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/decommission.py @@ -10,7 +10,7 @@ import logging from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.mysql_partition.client import DBPartitionApi from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py index dc47f70271..d3fb2695df 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbcluster/handler.py @@ -11,7 +11,7 @@ from django.db import transaction from django.db.models import F -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta import api diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/create_cluster.py index 3ec4f96f1e..ec8fcc8a64 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/create_cluster.py @@ -12,7 +12,7 @@ from typing import List, Optional from django.db import transaction -from django.utils.translation import ungettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py b/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py index 910e4a4ebb..f5813a54e3 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbha/decommission.py @@ -11,7 +11,7 @@ import logging from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBPrivManagerApi from backend.components.mysql_partition.client import DBPartitionApi diff --git a/dbm-ui/backend/db_meta/api/cluster/tendbsingle/create_cluster.py b/dbm-ui/backend/db_meta/api/cluster/tendbsingle/create_cluster.py index dcb4dfa6e1..852e748a1a 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendbsingle/create_cluster.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendbsingle/create_cluster.py @@ -12,7 +12,7 @@ from typing import Dict from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import request_validator from backend.db_meta.api import common diff --git a/dbm-ui/backend/db_meta/api/cluster/tendispluscluster/create.py b/dbm-ui/backend/db_meta/api/cluster/tendispluscluster/create.py index b0ece2661d..2ed65cf4e8 100644 --- a/dbm-ui/backend/db_meta/api/cluster/tendispluscluster/create.py +++ b/dbm-ui/backend/db_meta/api/cluster/tendispluscluster/create.py @@ -13,7 +13,7 @@ from typing import List, Optional from django.db import IntegrityError, transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import DEFAULT_BK_CLOUD_ID from backend.db_meta import request_validator diff --git a/dbm-ui/backend/db_meta/api/dbha/apis.py b/dbm-ui/backend/db_meta/api/dbha/apis.py index ac0bd98cb9..d4892c6ee4 100644 --- a/dbm-ui/backend/db_meta/api/dbha/apis.py +++ b/dbm-ui/backend/db_meta/api/dbha/apis.py @@ -16,7 +16,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from backend.constants import DEFAULT_BK_CLOUD_ID, IP_PORT_DIVIDER diff --git a/dbm-ui/backend/db_meta/api/priv_manager/__init__.py b/dbm-ui/backend/db_meta/api/priv_manager/__init__.py index 664e4d5078..c1f4eeea4a 100644 --- a/dbm-ui/backend/db_meta/api/priv_manager/__init__.py +++ b/dbm-ui/backend/db_meta/api/priv_manager/__init__.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from . import sqlserver, tendbcluster, tendbha, tendbsingle +from . import mysql_on_k8s, sqlserver, tendbcluster, tendbha, tendbsingle from .biz_clusters import biz_clusters from .cluster_instances import cluster_instances from .instance_detail import instance_detail diff --git a/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/__init__.py b/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/__init__.py new file mode 100644 index 0000000000..35e744309c --- /dev/null +++ b/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/__init__.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from .cluster_instances import cluster_instances diff --git a/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/cluster_instances.py b/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/cluster_instances.py new file mode 100644 index 0000000000..8e0da2299a --- /dev/null +++ b/dbm-ui/backend/db_meta/api/priv_manager/mysql_on_k8s/cluster_instances.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from backend.db_meta.enums import AccessLayer, ClusterType +from backend.db_meta.exceptions import ClusterEntryNotExistException +from backend.db_meta.models import ClusterEntry + + +def cluster_instances(entry_name: str): + try: + input_entry = ClusterEntry.objects.get(entry=entry_name, cluster__cluster_type=ClusterType.MySQLOnK8S.value) + cluster = input_entry.cluster + return { + "bind_to": AccessLayer.STORAGE.value, + "entry_role": input_entry.role, + "cluster_type": cluster.cluster_type, + "bk_biz_id": cluster.bk_biz_id, + "db_module_id": cluster.db_module_id, + "bk_cloud_id": cluster.bk_cloud_id, + "immute_domain": cluster.immute_domain, + "storages": [], + } + except ClusterEntry.DoesNotExist: + raise ClusterEntryNotExistException(entry=entry_name) diff --git a/dbm-ui/backend/db_meta/api/priv_manager/tendbsingle/cluster_instances.py b/dbm-ui/backend/db_meta/api/priv_manager/tendbsingle/cluster_instances.py index 592675a750..5a626fa662 100644 --- a/dbm-ui/backend/db_meta/api/priv_manager/tendbsingle/cluster_instances.py +++ b/dbm-ui/backend/db_meta/api/priv_manager/tendbsingle/cluster_instances.py @@ -9,8 +9,6 @@ specific language governing permissions and limitations under the License. """ -from django.core.exceptions import ObjectDoesNotExist - from backend.db_meta.enums import AccessLayer, ClusterType from backend.db_meta.exceptions import ClusterEntryNotExistException from backend.db_meta.models import ClusterEntry @@ -20,8 +18,6 @@ def cluster_instances(entry_name: str): try: input_entry = ClusterEntry.objects.get(entry=entry_name, cluster__cluster_type=ClusterType.TenDBSingle.value) cluster = input_entry.cluster - - storage_instance = cluster.storageinstance_set.first() return { "bind_to": AccessLayer.STORAGE.value, "entry_role": input_entry.role, @@ -40,8 +36,9 @@ def cluster_instances(entry_name: str): "status": storage_instance.status, "bk_instance_id": storage_instance.bk_instance_id, } + for storage_instance in cluster.storageinstance_set.all() ], } - except ObjectDoesNotExist: + except ClusterEntry.DoesNotExist: raise ClusterEntryNotExistException(entry=entry_name) diff --git a/dbm-ui/backend/db_meta/enums/cluster_entry_type.py b/dbm-ui/backend/db_meta/enums/cluster_entry_type.py index fd74231233..b19e4aa691 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_entry_type.py +++ b/dbm-ui/backend/db_meta/enums/cluster_entry_type.py @@ -15,6 +15,7 @@ class ClusterEntryType(str, StructuredEnum): DNS = EnumField("dns", _("dns")) + K8SService = EnumField("k8s_service", _("k8s_service")) CLB = EnumField("clb", _("clb")) POLARIS = EnumField("polaris", _("polaris")) CLBDNS = EnumField("clbDns", _("clbDns")) diff --git a/dbm-ui/backend/db_meta/enums/cluster_type.py b/dbm-ui/backend/db_meta/enums/cluster_type.py index 94b4924b09..82573e65da 100644 --- a/dbm-ui/backend/db_meta/enums/cluster_type.py +++ b/dbm-ui/backend/db_meta/enums/cluster_type.py @@ -21,6 +21,12 @@ class ClusterType(str, StructuredEnum): TenDBHA = EnumField("tendbha", _("tendbha")) TenDBCluster = EnumField("tendbcluster", _("tendbcluster")) + MySQLOnK8S = EnumField("MySQLOnK8S", _("MySQLOnK8S")) + RedisOnK8S = EnumField("RedisOnK8S", _("RedisOnK8S")) + RedisClusterOnK8S = EnumField("RedisClusterOnK8S", _("RedisClusterOnK8S")) + MongoDBOnK8S = EnumField("MongoDBOnK8S", _("MongoDBOnK8S")) + EsOnK8S = EnumField("EsOnK8S", _("EsOnK8S")) + RedisCluster = EnumField("redis", _("Redis")) TendisPredixyRedisCluster = EnumField("PredixyRedisCluster", _("Redis集群")) TendisPredixyTendisplusCluster = EnumField("PredixyTendisplusCluster", _("Tendisplus存储版集群")) @@ -62,7 +68,7 @@ def db_type_cluster_types_map(cls) -> Dict[str, List]: """ return { DBType.InfluxDB.value: [ClusterType.Influxdb], - DBType.MySQL.value: [cls.TenDBSingle, cls.TenDBHA], + DBType.MySQL.value: [cls.TenDBSingle, cls.TenDBHA, cls.MySQLOnK8S], DBType.TenDBCluster.value: [cls.TenDBCluster], DBType.Redis.value: [ cls.RedisCluster, diff --git a/dbm-ui/backend/db_meta/enums/extra_process_type.py b/dbm-ui/backend/db_meta/enums/extra_process_type.py index d7da4b04b5..e36804e3e2 100644 --- a/dbm-ui/backend/db_meta/enums/extra_process_type.py +++ b/dbm-ui/backend/db_meta/enums/extra_process_type.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_meta/exceptions.py b/dbm-ui/backend/db_meta/exceptions.py index f237833b12..4d6f6ef96b 100644 --- a/dbm-ui/backend/db_meta/exceptions.py +++ b/dbm-ui/backend/db_meta/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_meta/migrations/0036_auto_20240405_1608.py b/dbm-ui/backend/db_meta/migrations/0036_auto_20240405_1608.py new file mode 100644 index 0000000000..e47e84955d --- /dev/null +++ b/dbm-ui/backend/db_meta/migrations/0036_auto_20240405_1608.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.19 on 2024-04-05 08:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("db_meta", "0035_machine_system_info"), + ] + + operations = [ + migrations.AddField( + model_name="clusterentry", + name="access_port", + field=models.IntegerField(default=0, help_text="数据库服务的端口", verbose_name="端口"), + ), + migrations.AlterUniqueTogether( + name="sqlserverdtsinfo", + unique_together={("ticket_id", "source_cluster_id", "target_cluster_id")}, + ), + ] diff --git a/dbm-ui/backend/db_meta/models/app.py b/dbm-ui/backend/db_meta/models/app.py index cf532359b5..ef00884515 100644 --- a/dbm-ui/backend/db_meta/models/app.py +++ b/dbm-ui/backend/db_meta/models/app.py @@ -11,7 +11,7 @@ import logging from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.components import CCApi diff --git a/dbm-ui/backend/db_meta/models/city_map.py b/dbm-ui/backend/db_meta/models/city_map.py index 16a5374a90..378a00dd20 100644 --- a/dbm-ui/backend/db_meta/models/city_map.py +++ b/dbm-ui/backend/db_meta/models/city_map.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_meta/models/cluster.py b/dbm-ui/backend/db_meta/models/cluster.py index 1e33c70837..22547098df 100644 --- a/dbm-ui/backend/db_meta/models/cluster.py +++ b/dbm-ui/backend/db_meta/models/cluster.py @@ -14,13 +14,13 @@ from django.core.cache import cache from django.db import models -from django.db.models import Count, Q, QuerySet +from django.db.models import Count, QuerySet from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.components.db_remote_service.client import DRSApi -from backend.configuration.constants import AffinityEnum, DBType +from backend.configuration.constants import AffinityEnum from backend.constants import CACHE_CLUSTER_STATS, DEFAULT_BK_CLOUD_ID, DEFAULT_TIME_ZONE, IP_PORT_DIVIDER from backend.db_meta.enums import ( ClusterDBHAStatusFlags, @@ -37,7 +37,6 @@ from backend.db_meta.enums.cluster_status import ClusterDBSingleStatusFlags, ClusterStatusFlags from backend.db_meta.exceptions import ClusterExclusiveOperateException, DBMetaException from backend.db_services.version.constants import LATEST, PredixyVersion, TwemproxyVersion -from backend.flow.consts import DEFAULT_RIAK_PORT from backend.ticket.constants import TicketType from backend.ticket.models import ClusterOperateRecord @@ -228,6 +227,7 @@ def main_storage_instances(self) -> QuerySet: def access_port(self) -> int: """ 获取集群的访问端口,如果要批量查询,请使用prefetch预存instance得queryset + 默认取 proxy 的 port,若无 proxy 则取存储实例的 port,特殊情况另论 tendbsingle: 只有一台机器,直接取那个port tendbha, redis: 取proxy的一台port tendbcluster: 主域名取spider master的port 从域名取spider slave的port @@ -235,30 +235,42 @@ def access_port(self) -> int: kafka: broker hdfs: namenode pulsar: broker - riak: 固定为8087 - mongo: ? + mongo: MONGOS/MONGODB """ - if self.cluster_type == ClusterType.TenDBSingle: - return self.storageinstance_set.first().port - elif self.cluster_type in [ClusterType.TenDBHA, *ClusterType.db_type_to_cluster_types(DBType.Redis)]: - return self.proxyinstance_set.first().port - elif self.cluster_type == ClusterType.TenDBCluster: - spider_master_filter = Q(tendbclusterspiderext__spider_role=TenDBClusterSpiderRole.SPIDER_MASTER) - return self.proxyinstance_set.filter(spider_master_filter).first().port - elif self.cluster_type == ClusterType.Es: - return self.storageinstance_set.filter(instance_role=InstanceRole.ES_DATANODE_HOT).first().port - elif self.cluster_type == ClusterType.Kafka: - return self.storageinstance_set.filter(instance_role=InstanceRole.BROKER).first().port - elif self.cluster_type == ClusterType.Hdfs: - return self.storageinstance_set.filter(instance_role=InstanceRole.HDFS_NAME_NODE).first().port - elif self.cluster_type == ClusterType.Pulsar: - return self.storageinstance_set.filter(instance_role=InstanceRole.PULSAR_BROKER).first().port - elif self.cluster_type == ClusterType.Riak: - return DEFAULT_RIAK_PORT - elif self.cluster_type == ClusterType.MongoShardedCluster: - return self.proxyinstance_set.filter(machine_type=MachineType.MONGOS).first().port - elif self.cluster_type == ClusterType.MongoReplicaSet: - return self.storageinstance_set.filter(machine_type=MachineType.MONGODB).first().port + # 特殊场景 + cluster_type_filter_storage_condition_map = { + ClusterType.Es.value: dict(instance_role=InstanceRole.ES_DATANODE_HOT), + ClusterType.Kafka.value: dict(instance_role=InstanceRole.BROKER), + ClusterType.Hdfs.value: dict(instance_role=InstanceRole.HDFS_NAME_NODE), + ClusterType.Pulsar.value: dict(instance_role=InstanceRole.PULSAR_BROKER), + ClusterType.MongoReplicaSet.value: dict(machine_type=MachineType.MONGODB), + } + cluster_type_filter_proxy_condition_map = { + ClusterType.TenDBCluster.value: dict( + tendbclusterspiderext__spider_role=TenDBClusterSpiderRole.SPIDER_MASTER + ), + ClusterType.MongoShardedCluster.value: dict(machine_type=MachineType.MONGOS), + } + if self.cluster_type in cluster_type_filter_storage_condition_map: + queryset = self.storageinstance_set.filter(**cluster_type_filter_storage_condition_map[self.cluster_type]) + elif self.cluster_type in cluster_type_filter_proxy_condition_map: + queryset = self.proxyinstance_set.filter(**cluster_type_filter_proxy_condition_map[self.cluster_type]) + else: + queryset = None + + if queryset is None: + # 非特殊情况,默认取 proxy 的端口 + instance = self.proxyinstance_set.first() + if instance is None: + # 如果没有 proxy,则取 storage 的端口 + instance = self.storageinstance_set.first() + else: + # 特殊指定的,根据 queryset 得出的第一个实例的端口 + instance = queryset.first() + + if instance: + return instance.port + return 0 def get_partition_port(self): """ diff --git a/dbm-ui/backend/db_meta/models/cluster_entry.py b/dbm-ui/backend/db_meta/models/cluster_entry.py index 4f39d4f568..c2e7c71c50 100644 --- a/dbm-ui/backend/db_meta/models/cluster_entry.py +++ b/dbm-ui/backend/db_meta/models/cluster_entry.py @@ -14,7 +14,7 @@ from django.db import models from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.bk_web.models import AuditedModel @@ -35,6 +35,7 @@ class ClusterEntry(AuditedModel): cluster = models.ForeignKey(Cluster, on_delete=models.PROTECT) cluster_entry_type = models.CharField(max_length=64, choices=ClusterEntryType.get_choices(), default="") entry = models.CharField(max_length=200, unique=True, default="") + access_port = models.IntegerField(_("端口"), help_text=_("数据库服务的端口"), default=0) forward_to = models.ForeignKey( "self", diff --git a/dbm-ui/backend/db_meta/models/cluster_monitor.py b/dbm-ui/backend/db_meta/models/cluster_monitor.py index bd40db1c79..f4ac8ee856 100644 --- a/dbm-ui/backend/db_meta/models/cluster_monitor.py +++ b/dbm-ui/backend/db_meta/models/cluster_monitor.py @@ -11,7 +11,7 @@ import logging from django.db import models, transaction -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.bk_web.constants import LEN_X_LONG diff --git a/dbm-ui/backend/db_meta/models/db_module.py b/dbm-ui/backend/db_meta/models/db_module.py index 3ecf8e911d..2909cae8c3 100644 --- a/dbm-ui/backend/db_meta/models/db_module.py +++ b/dbm-ui/backend/db_meta/models/db_module.py @@ -12,7 +12,7 @@ from django.db import models from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterEntryType diff --git a/dbm-ui/backend/db_meta/models/extra_process.py b/dbm-ui/backend/db_meta/models/extra_process.py index 104aaf350a..88575fdcc4 100644 --- a/dbm-ui/backend/db_meta/models/extra_process.py +++ b/dbm-ui/backend/db_meta/models/extra_process.py @@ -11,7 +11,7 @@ import logging from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterPhase diff --git a/dbm-ui/backend/db_meta/models/group.py b/dbm-ui/backend/db_meta/models/group.py index d8c7099bf0..282b3d59e7 100644 --- a/dbm-ui/backend/db_meta/models/group.py +++ b/dbm-ui/backend/db_meta/models/group.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_meta/models/instance.py b/dbm-ui/backend/db_meta/models/instance.py index 26315adc15..7722cd1031 100644 --- a/dbm-ui/backend/db_meta/models/instance.py +++ b/dbm-ui/backend/db_meta/models/instance.py @@ -14,7 +14,7 @@ from django.db import models from django.db.models import Q, QuerySet -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ( diff --git a/dbm-ui/backend/db_meta/models/machine.py b/dbm-ui/backend/db_meta/models/machine.py index 18bd6dd5ad..fc9aa7fac0 100644 --- a/dbm-ui/backend/db_meta/models/machine.py +++ b/dbm-ui/backend/db_meta/models/machine.py @@ -15,7 +15,7 @@ from django.db import models from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.components import CCApi diff --git a/dbm-ui/backend/db_meta/models/spec.py b/dbm-ui/backend/db_meta/models/spec.py index 67b654962a..c3acb448e5 100644 --- a/dbm-ui/backend/db_meta/models/spec.py +++ b/dbm-ui/backend/db_meta/models/spec.py @@ -10,12 +10,14 @@ """ import json import logging +import os.path from collections import defaultdict from typing import Dict, List +from django.conf import settings from django.db import models from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.configuration.constants import AffinityEnum, SystemSettingsEnum @@ -184,7 +186,7 @@ def init_spec(cls): for spec in Spec.objects.all(): spec_namespace__name[spec.spec_cluster_type][spec.spec_machine_type].append(spec.spec_name) - with open("backend/db_meta/init/spec_init.json", "r") as f: + with open(os.path.join(settings.BASE_DIR, "backend/db_meta/init/spec_init.json"), "r") as f: system_spec_init_map = json.loads(f.read()) to_init_specs: List[Spec] = [] diff --git a/dbm-ui/backend/db_meta/models/storage_instance_tuple.py b/dbm-ui/backend/db_meta/models/storage_instance_tuple.py index 6622d871b7..483b161d76 100644 --- a/dbm-ui/backend/db_meta/models/storage_instance_tuple.py +++ b/dbm-ui/backend/db_meta/models/storage_instance_tuple.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.models import StorageInstance diff --git a/dbm-ui/backend/db_meta/models/tag.py b/dbm-ui/backend/db_meta/models/tag.py index ecdd353bd5..199e606224 100644 --- a/dbm-ui/backend/db_meta/models/tag.py +++ b/dbm-ui/backend/db_meta/models/tag.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums.comm import TagType diff --git a/dbm-ui/backend/db_meta/utils.py b/dbm-ui/backend/db_meta/utils.py index 4e7a31410c..3612f1883b 100644 --- a/dbm-ui/backend/db_meta/utils.py +++ b/dbm-ui/backend/db_meta/utils.py @@ -13,7 +13,7 @@ from collections import defaultdict from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import CCApi, JobApi diff --git a/dbm-ui/backend/db_monitor/constants.py b/dbm-ui/backend/db_monitor/constants.py index 40814041ef..800d8237cd 100644 --- a/dbm-ui/backend/db_monitor/constants.py +++ b/dbm-ui/backend/db_monitor/constants.py @@ -11,7 +11,7 @@ import os from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_monitor/exceptions.py b/dbm-ui/backend/db_monitor/exceptions.py index 1953c9fdd1..1edaafbec7 100644 --- a/dbm-ui/backend/db_monitor/exceptions.py +++ b/dbm-ui/backend/db_monitor/exceptions.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_monitor/mock_data.py b/dbm-ui/backend/db_monitor/mock_data.py index a76e1494c2..edc90a333b 100644 --- a/dbm-ui/backend/db_monitor/mock_data.py +++ b/dbm-ui/backend/db_monitor/mock_data.py @@ -10,7 +10,7 @@ """ import copy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ GET_MESSAGE_TYPE = [ {"type": "rtx", "label": _("企业微信"), "is_active": True, "icon": "base64xxxxxxx"}, diff --git a/dbm-ui/backend/db_monitor/views/duty_rule.py b/dbm-ui/backend/db_monitor/views/duty_rule.py index 60cb7575d5..31f104346a 100644 --- a/dbm-ui/backend/db_monitor/views/duty_rule.py +++ b/dbm-ui/backend/db_monitor/views/duty_rule.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import filters from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_monitor/views/grafana.py b/dbm-ui/backend/db_monitor/views/grafana.py index 8d52dc7b3c..98368f59cb 100644 --- a/dbm-ui/backend/db_monitor/views/grafana.py +++ b/dbm-ui/backend/db_monitor/views/grafana.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_monitor/views/notice_group.py b/dbm-ui/backend/db_monitor/views/notice_group.py index 9f4a3d5f53..b59f030aa3 100644 --- a/dbm-ui/backend/db_monitor/views/notice_group.py +++ b/dbm-ui/backend/db_monitor/views/notice_group.py @@ -13,7 +13,7 @@ import django_filters from django.db.models import OuterRef, Q, Subquery from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_monitor/views/policy.py b/dbm-ui/backend/db_monitor/views/policy.py index bac7ec8b33..02b457c75b 100644 --- a/dbm-ui/backend/db_monitor/views/policy.py +++ b/dbm-ui/backend/db_monitor/views/policy.py @@ -13,7 +13,7 @@ from django.core.cache import cache from django.db.models import Q from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django_filters import rest_framework as filters from rest_framework import status from rest_framework.decorators import action diff --git a/dbm-ui/backend/db_package/constants.py b/dbm-ui/backend/db_package/constants.py index 9d744bbbc8..a49a4e7784 100644 --- a/dbm-ui/backend/db_package/constants.py +++ b/dbm-ui/backend/db_package/constants.py @@ -10,7 +10,7 @@ """ import re -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from backend.flow.consts import MediumEnum diff --git a/dbm-ui/backend/db_package/exceptions.py b/dbm-ui/backend/db_package/exceptions.py index cf2e71bce3..11627454c0 100644 --- a/dbm-ui/backend/db_package/exceptions.py +++ b/dbm-ui/backend/db_package/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_package/filters.py b/dbm-ui/backend/db_package/filters.py index 41cc729b9d..9285fb2bbc 100644 --- a/dbm-ui/backend/db_package/filters.py +++ b/dbm-ui/backend/db_package/filters.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import FilterSet, filters from backend.db_package.models import Package diff --git a/dbm-ui/backend/db_package/models.py b/dbm-ui/backend/db_package/models.py index 6ca0a47b39..bd550a9a14 100644 --- a/dbm-ui/backend/db_package/models.py +++ b/dbm-ui/backend/db_package/models.py @@ -13,7 +13,7 @@ import django.utils.timezone as timezone from django.db import models from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_LONG, LEN_NORMAL, LEN_SHORT from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_package/views.py b/dbm-ui/backend/db_package/views.py index a6d1d4a1e4..3c1ca541a3 100644 --- a/dbm-ui/backend/db_package/views.py +++ b/dbm-ui/backend/db_package/views.py @@ -14,7 +14,7 @@ from django.core.files.uploadedfile import InMemoryUploadedFile from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.parsers import MultiPartParser from rest_framework.response import Response diff --git a/dbm-ui/backend/db_periodic_task/constants.py b/dbm-ui/backend/db_periodic_task/constants.py index 816de317ed..221fd297a5 100644 --- a/dbm-ui/backend/db_periodic_task/constants.py +++ b/dbm-ui/backend/db_periodic_task/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/check_checksum.py b/dbm-ui/backend/db_periodic_task/local_tasks/check_checksum.py index 0050fb0edd..a7ad1a777d 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/check_checksum.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/check_checksum.py @@ -6,7 +6,7 @@ from blueapps.core.celery.celery import app from celery.schedules import crontab from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import BKLogApi diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py index adb55d14b8..43732c3e49 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_cluster_topo.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType, InstanceInnerRole, InstanceRole, MachineType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py index 626ac33195..8e21caf7c6 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_instance_belong.py @@ -10,7 +10,7 @@ """ from django.db.models import Count, Q, QuerySet -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.models import ProxyInstance, StorageInstance from backend.db_report.enums import MetaCheckSubType diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_redis_instance.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_redis_instance.py index cf176a53bf..1b4fb0599b 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_redis_instance.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_redis_instance.py @@ -14,7 +14,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType, InstanceRole, InstanceStatus from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py index b50df93486..6cb8a4bee8 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_meta/db_meta_check/check_replicate_role.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import InstanceInnerRole from backend.db_meta.models import StorageInstanceTuple diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/db_proxy.py b/dbm-ui/backend/db_periodic_task/local_tasks/db_proxy.py index 60f8a5d376..0a810d9313 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/db_proxy.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/db_proxy.py @@ -15,7 +15,7 @@ from typing import Dict, List from celery.schedules import crontab -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from backend import env diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/dbmon_heartbeat/heartbeat_report.py b/dbm-ui/backend/db_periodic_task/local_tasks/dbmon_heartbeat/heartbeat_report.py index 02e9bd46fd..d5a8974962 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/dbmon_heartbeat/heartbeat_report.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/dbmon_heartbeat/heartbeat_report.py @@ -15,7 +15,7 @@ from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import BKMonitorV3Api diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/bklog_query.py b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/bklog_query.py index c15fd3c168..69437c79f9 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/bklog_query.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/bklog_query.py @@ -13,7 +13,7 @@ import logging from typing import Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components.bklog.client import BKLogApi diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_binlog_backup.py b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_binlog_backup.py index 3d6a31c094..bc2cac1bf4 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_binlog_backup.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_binlog_backup.py @@ -13,7 +13,7 @@ from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_full_backup.py b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_full_backup.py index 392a20a181..1e07b178b7 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_full_backup.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_full_backup.py @@ -14,7 +14,7 @@ from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_rollback_time_backup.py b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_rollback_time_backup.py index 9bbaae1af5..a4a59cc621 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_rollback_time_backup.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/redis_backup/check_rollback_time_backup.py @@ -11,7 +11,7 @@ import logging.config from typing import Any, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/db_periodic_task/local_tasks/redis_clusternodes_update/task.py b/dbm-ui/backend/db_periodic_task/local_tasks/redis_clusternodes_update/task.py index d496068e59..d75ae1fb33 100644 --- a/dbm-ui/backend/db_periodic_task/local_tasks/redis_clusternodes_update/task.py +++ b/dbm-ui/backend/db_periodic_task/local_tasks/redis_clusternodes_update/task.py @@ -20,7 +20,7 @@ from django.db.models import Q from django.utils import timezone from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.components.bklog.client import BKLogApi diff --git a/dbm-ui/backend/db_periodic_task/models.py b/dbm-ui/backend/db_periodic_task/models.py index cf84afe5ae..7b10a29f25 100644 --- a/dbm-ui/backend/db_periodic_task/models.py +++ b/dbm-ui/backend/db_periodic_task/models.py @@ -13,7 +13,7 @@ import logging from django.db import models, transaction -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_celery_beat.models import PeriodicTask from django_celery_beat.schedulers import ModelEntry diff --git a/dbm-ui/backend/db_proxy/constants.py b/dbm-ui/backend/db_proxy/constants.py index 375afe0304..6c9975ec26 100644 --- a/dbm-ui/backend/db_proxy/constants.py +++ b/dbm-ui/backend/db_proxy/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_proxy/views/bkrepo/views.py b/dbm-ui/backend/db_proxy/views/bkrepo/views.py index 7bd7ccefa9..363a2ac92b 100644 --- a/dbm-ui/backend/db_proxy/views/bkrepo/views.py +++ b/dbm-ui/backend/db_proxy/views/bkrepo/views.py @@ -11,7 +11,7 @@ import os -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/db_meta/views.py b/dbm-ui/backend/db_proxy/views/db_meta/views.py index 5f8f734610..62b11f0f57 100644 --- a/dbm-ui/backend/db_proxy/views/db_meta/views.py +++ b/dbm-ui/backend/db_proxy/views/db_meta/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response @@ -398,6 +398,22 @@ def tendbsingle_biz_clusters(self, request): data = api.priv_manager.tendbsingle.biz_clusters(**validated_data) return Response(data) + @common_swagger_auto_schema( + operation_summary=_("[dbmeta]priv_manager查询MySQLONK8s集群信息"), + request_body=TendbInstancesSerializer(), + tags=[SWAGGER_TAG], + ) + @action( + methods=["POST"], + detail=False, + serializer_class=TendbInstancesSerializer, + url_path="dbmeta/priv_manager/MySQLOnK8S/cluster_instances", + ) + def mysqlonk8s_cluster_instances(self, request): + validated_data = self.params_validate(self.get_serializer_class()) + data = api.priv_manager.mysql_on_k8s.cluster_instances(validated_data.get("entry_name")) + return Response(data) + @common_swagger_auto_schema( operation_summary=_("[dbmeta]priv_manager查询SqlserverHA集群信息"), request_body=TendbInstancesSerializer(), diff --git a/dbm-ui/backend/db_proxy/views/db_remote_service/views.py b/dbm-ui/backend/db_proxy/views/db_remote_service/views.py index 087fd30185..a58d1210ab 100644 --- a/dbm-ui/backend/db_proxy/views/db_remote_service/views.py +++ b/dbm-ui/backend/db_proxy/views/db_remote_service/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/dbconfig/views.py b/dbm-ui/backend/db_proxy/views/dbconfig/views.py index 916014a98f..acb2e503ec 100644 --- a/dbm-ui/backend/db_proxy/views/dbconfig/views.py +++ b/dbm-ui/backend/db_proxy/views/dbconfig/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/dbpriv/serializers.py b/dbm-ui/backend/db_proxy/views/dbpriv/serializers.py index a58a8657b9..012f50789a 100644 --- a/dbm-ui/backend/db_proxy/views/dbpriv/serializers.py +++ b/dbm-ui/backend/db_proxy/views/dbpriv/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.views.serialiers import BaseProxyPassSerializer diff --git a/dbm-ui/backend/db_proxy/views/dbpriv/views.py b/dbm-ui/backend/db_proxy/views/dbpriv/views.py index 076367d9a8..4b00e75105 100644 --- a/dbm-ui/backend/db_proxy/views/dbpriv/views.py +++ b/dbm-ui/backend/db_proxy/views/dbpriv/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/dns/views.py b/dbm-ui/backend/db_proxy/views/dns/views.py index 1fc852de45..865660f0d2 100644 --- a/dbm-ui/backend/db_proxy/views/dns/views.py +++ b/dbm-ui/backend/db_proxy/views/dns/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/dumper/views.py b/dbm-ui/backend/db_proxy/views/dumper/views.py index 8b80e02bde..2aeb2e5472 100644 --- a/dbm-ui/backend/db_proxy/views/dumper/views.py +++ b/dbm-ui/backend/db_proxy/views/dumper/views.py @@ -11,7 +11,7 @@ from collections import defaultdict from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/hadb/views.py b/dbm-ui/backend/db_proxy/views/hadb/views.py index a18441d045..73c23bc8dd 100644 --- a/dbm-ui/backend/db_proxy/views/hadb/views.py +++ b/dbm-ui/backend/db_proxy/views/hadb/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/job_callback/serialiers.py b/dbm-ui/backend/db_proxy/views/job_callback/serialiers.py index f5d59d4b15..c44b95f5bf 100644 --- a/dbm-ui/backend/db_proxy/views/job_callback/serialiers.py +++ b/dbm-ui/backend/db_proxy/views/job_callback/serialiers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers diff --git a/dbm-ui/backend/db_proxy/views/job_callback/views.py b/dbm-ui/backend/db_proxy/views/job_callback/views.py index fc0924aaef..dd7ef7b6e4 100644 --- a/dbm-ui/backend/db_proxy/views/job_callback/views.py +++ b/dbm-ui/backend/db_proxy/views/job_callback/views.py @@ -12,7 +12,7 @@ import json import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/jobapi/views.py b/dbm-ui/backend/db_proxy/views/jobapi/views.py index 5a9e3452d6..9f772ffaa4 100644 --- a/dbm-ui/backend/db_proxy/views/jobapi/views.py +++ b/dbm-ui/backend/db_proxy/views/jobapi/views.py @@ -10,7 +10,7 @@ """ from typing import Any, Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/nameservice/views.py b/dbm-ui/backend/db_proxy/views/nameservice/views.py index 5df58e5f8d..c8b3bad4e5 100644 --- a/dbm-ui/backend/db_proxy/views/nameservice/views.py +++ b/dbm-ui/backend/db_proxy/views/nameservice/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/redis_dts/views.py b/dbm-ui/backend/db_proxy/views/redis_dts/views.py index c3a3278dcd..95829ede5f 100644 --- a/dbm-ui/backend/db_proxy/views/redis_dts/views.py +++ b/dbm-ui/backend/db_proxy/views/redis_dts/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_proxy/views/serialiers.py b/dbm-ui/backend/db_proxy/views/serialiers.py index 303d4068ba..a73993626c 100644 --- a/dbm-ui/backend/db_proxy/views/serialiers.py +++ b/dbm-ui/backend/db_proxy/views/serialiers.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers logger = logging.getLogger("root") diff --git a/dbm-ui/backend/db_report/enums/__init__.py b/dbm-ui/backend/db_report/enums/__init__.py index 220cfc1663..066beb7279 100644 --- a/dbm-ui/backend/db_report/enums/__init__.py +++ b/dbm-ui/backend/db_report/enums/__init__.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_report/models/checksum_check_report.py b/dbm-ui/backend/db_report/models/checksum_check_report.py index ed098ff304..d777cca7f9 100644 --- a/dbm-ui/backend/db_report/models/checksum_check_report.py +++ b/dbm-ui/backend/db_report/models/checksum_check_report.py @@ -10,7 +10,7 @@ """ import django.db.models.deletion from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_report/models/dbmon_heartbeat_report.py b/dbm-ui/backend/db_report/models/dbmon_heartbeat_report.py index 84d15d442e..ef4fb3db23 100644 --- a/dbm-ui/backend/db_report/models/dbmon_heartbeat_report.py +++ b/dbm-ui/backend/db_report/models/dbmon_heartbeat_report.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_report.enums import DbmonHeartbeatReportSubType from backend.db_report.report_basemodel import BaseReportABS diff --git a/dbm-ui/backend/db_report/models/meta_check_report.py b/dbm-ui/backend/db_report/models/meta_check_report.py index 6ef6a0e7ee..cb9578aca9 100644 --- a/dbm-ui/backend/db_report/models/meta_check_report.py +++ b/dbm-ui/backend/db_report/models/meta_check_report.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType, MachineType from backend.db_report.enums import MetaCheckSubType diff --git a/dbm-ui/backend/db_report/models/mysqlbackup_check_report.py b/dbm-ui/backend/db_report/models/mysqlbackup_check_report.py index e1c7de5e99..b1545aa77f 100644 --- a/dbm-ui/backend/db_report/models/mysqlbackup_check_report.py +++ b/dbm-ui/backend/db_report/models/mysqlbackup_check_report.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType from backend.db_report.enums import MysqlBackupCheckSubType diff --git a/dbm-ui/backend/db_report/models/redisbackup_check_report.py b/dbm-ui/backend/db_report/models/redisbackup_check_report.py index c6e5ec58e6..b700e0a011 100644 --- a/dbm-ui/backend/db_report/models/redisbackup_check_report.py +++ b/dbm-ui/backend/db_report/models/redisbackup_check_report.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType from backend.db_report.enums import RedisBackupCheckSubType diff --git a/dbm-ui/backend/db_report/report_basemodel.py b/dbm-ui/backend/db_report/report_basemodel.py index 189b6fdb67..24fedf5ca4 100644 --- a/dbm-ui/backend/db_report/report_basemodel.py +++ b/dbm-ui/backend/db_report/report_basemodel.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_report/views/checksum_check_report_view.py b/dbm-ui/backend/db_report/views/checksum_check_report_view.py index f767537dea..bd1084979e 100644 --- a/dbm-ui/backend/db_report/views/checksum_check_report_view.py +++ b/dbm-ui/backend/db_report/views/checksum_check_report_view.py @@ -12,7 +12,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/checksum_instance_view.py b/dbm-ui/backend/db_report/views/checksum_instance_view.py index 744943bb57..e8be581fad 100644 --- a/dbm-ui/backend/db_report/views/checksum_instance_view.py +++ b/dbm-ui/backend/db_report/views/checksum_instance_view.py @@ -12,7 +12,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/dbmon_heartbeat_view.py b/dbm-ui/backend/db_report/views/dbmon_heartbeat_view.py index 736c70327a..879bb1c238 100644 --- a/dbm-ui/backend/db_report/views/dbmon_heartbeat_view.py +++ b/dbm-ui/backend/db_report/views/dbmon_heartbeat_view.py @@ -12,7 +12,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/meta_check_view.py b/dbm-ui/backend/db_report/views/meta_check_view.py index 8963c91e71..bd4cc1eb72 100644 --- a/dbm-ui/backend/db_report/views/meta_check_view.py +++ b/dbm-ui/backend/db_report/views/meta_check_view.py @@ -12,7 +12,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/mysqlbackup_check_view.py b/dbm-ui/backend/db_report/views/mysqlbackup_check_view.py index bfe432521e..b41493b329 100644 --- a/dbm-ui/backend/db_report/views/mysqlbackup_check_view.py +++ b/dbm-ui/backend/db_report/views/mysqlbackup_check_view.py @@ -12,7 +12,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/redis_dbmeta_check_view.py b/dbm-ui/backend/db_report/views/redis_dbmeta_check_view.py index 73a6d8d842..a1b9b5f1e4 100644 --- a/dbm-ui/backend/db_report/views/redis_dbmeta_check_view.py +++ b/dbm-ui/backend/db_report/views/redis_dbmeta_check_view.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_report/views/redisbackup_check_view.py b/dbm-ui/backend/db_report/views/redisbackup_check_view.py index 5e49ed398e..07d20b2244 100644 --- a/dbm-ui/backend/db_report/views/redisbackup_check_view.py +++ b/dbm-ui/backend/db_report/views/redisbackup_check_view.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers, status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_services/bigdata/es/query.py b/dbm-ui/backend/db_services/bigdata/es/query.py index e8b9d6cb77..1aebfb0ce3 100644 --- a/dbm-ui/backend/db_services/bigdata/es/query.py +++ b/dbm-ui/backend/db_services/bigdata/es/query.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.db_meta.api.cluster.es.detail import scan_cluster diff --git a/dbm-ui/backend/db_services/bigdata/es/views.py b/dbm-ui/backend/db_services/bigdata/es/views.py index f591d54d5e..406d5430cc 100644 --- a/dbm-ui/backend/db_services/bigdata/es/views.py +++ b/dbm-ui/backend/db_services/bigdata/es/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/bigdata/hdfs/query.py b/dbm-ui/backend/db_services/bigdata/hdfs/query.py index 971300c6f1..1f47388d15 100644 --- a/dbm-ui/backend/db_services/bigdata/hdfs/query.py +++ b/dbm-ui/backend/db_services/bigdata/hdfs/query.py @@ -11,7 +11,7 @@ from typing import Any, Dict, List, Set -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.hdfs.detail import scan_cluster from backend.db_meta.enums.cluster_type import ClusterType diff --git a/dbm-ui/backend/db_services/bigdata/hdfs/views.py b/dbm-ui/backend/db_services/bigdata/hdfs/views.py index ef4bddbe2e..0377a6bc29 100644 --- a/dbm-ui/backend/db_services/bigdata/hdfs/views.py +++ b/dbm-ui/backend/db_services/bigdata/hdfs/views.py @@ -11,7 +11,7 @@ from xml.etree.ElementTree import Element, SubElement, tostring from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/bigdata/influxdb/query.py b/dbm-ui/backend/db_services/bigdata/influxdb/query.py index fe86085f55..33bf93719a 100644 --- a/dbm-ui/backend/db_services/bigdata/influxdb/query.py +++ b/dbm-ui/backend/db_services/bigdata/influxdb/query.py @@ -11,7 +11,7 @@ from typing import Dict from django.db.models import F, Q, Value -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/db_services/bigdata/influxdb/serializers.py b/dbm-ui/backend/db_services/bigdata/influxdb/serializers.py index 9339b487ee..47fd4780df 100644 --- a/dbm-ui/backend/db_services/bigdata/influxdb/serializers.py +++ b/dbm-ui/backend/db_services/bigdata/influxdb/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.dbbase.resources.serializers import InstanceAddressSerializer diff --git a/dbm-ui/backend/db_services/bigdata/influxdb/views.py b/dbm-ui/backend/db_services/bigdata/influxdb/views.py index 6dfb1a9b3c..2302bd0275 100644 --- a/dbm-ui/backend/db_services/bigdata/influxdb/views.py +++ b/dbm-ui/backend/db_services/bigdata/influxdb/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action diff --git a/dbm-ui/backend/db_services/bigdata/kafka/query.py b/dbm-ui/backend/db_services/bigdata/kafka/query.py index 20f9452cef..b86d6adb9c 100644 --- a/dbm-ui/backend/db_services/bigdata/kafka/query.py +++ b/dbm-ui/backend/db_services/bigdata/kafka/query.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.kafka.detail import scan_cluster from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/db_services/bigdata/kafka/views.py b/dbm-ui/backend/db_services/bigdata/kafka/views.py index 555dfba596..184d31cac8 100644 --- a/dbm-ui/backend/db_services/bigdata/kafka/views.py +++ b/dbm-ui/backend/db_services/bigdata/kafka/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_services/bigdata/pulsar/query.py b/dbm-ui/backend/db_services/bigdata/pulsar/query.py index 9f6cad0a98..35b946ec36 100644 --- a/dbm-ui/backend/db_services/bigdata/pulsar/query.py +++ b/dbm-ui/backend/db_services/bigdata/pulsar/query.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.pulsar.detail import scan_cluster from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/db_services/bigdata/pulsar/views.py b/dbm-ui/backend/db_services/bigdata/pulsar/views.py index 475804ec10..51379ec520 100644 --- a/dbm-ui/backend/db_services/bigdata/pulsar/views.py +++ b/dbm-ui/backend/db_services/bigdata/pulsar/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_services/bigdata/resources/query.py b/dbm-ui/backend/db_services/bigdata/resources/query.py index 1103b21768..d8ef0b04a9 100644 --- a/dbm-ui/backend/db_services/bigdata/resources/query.py +++ b/dbm-ui/backend/db_services/bigdata/resources/query.py @@ -12,7 +12,7 @@ from typing import Any, Dict, List from django.db.models import Count, F -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.db_meta.models.cluster import Cluster diff --git a/dbm-ui/backend/db_services/bigdata/resources/views.py b/dbm-ui/backend/db_services/bigdata/resources/views.py index 1ed9be1232..7cb24853da 100644 --- a/dbm-ui/backend/db_services/bigdata/resources/views.py +++ b/dbm-ui/backend/db_services/bigdata/resources/views.py @@ -12,7 +12,7 @@ from functools import wraps from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/bigdata/riak/query.py b/dbm-ui/backend/db_services/bigdata/riak/query.py index 1488027828..9cf8ada6af 100644 --- a/dbm-ui/backend/db_services/bigdata/riak/query.py +++ b/dbm-ui/backend/db_services/bigdata/riak/query.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.riak.detail import scan_cluster from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/db_services/bigdata/riak/views.py b/dbm-ui/backend/db_services/bigdata/riak/views.py index 2603e5b682..af42948b7c 100644 --- a/dbm-ui/backend/db_services/bigdata/riak/views.py +++ b/dbm-ui/backend/db_services/bigdata/riak/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_services/cluster_entry/serializers.py b/dbm-ui/backend/db_services/cluster_entry/serializers.py index 5a514892d2..c471083c34 100644 --- a/dbm-ui/backend/db_services/cluster_entry/serializers.py +++ b/dbm-ui/backend/db_services/cluster_entry/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import ClusterEntryType diff --git a/dbm-ui/backend/db_services/cluster_entry/views.py b/dbm-ui/backend/db_services/cluster_entry/views.py index 2042414150..d3d2260351 100644 --- a/dbm-ui/backend/db_services/cluster_entry/views.py +++ b/dbm-ui/backend/db_services/cluster_entry/views.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/cmdb/exceptions.py b/dbm-ui/backend/db_services/cmdb/exceptions.py index 719d145526..8222187c7e 100644 --- a/dbm-ui/backend/db_services/cmdb/exceptions.py +++ b/dbm-ui/backend/db_services/cmdb/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/cmdb/views.py b/dbm-ui/backend/db_services/cmdb/views.py index cef69b03d7..fe94a5814b 100644 --- a/dbm-ui/backend/db_services/cmdb/views.py +++ b/dbm-ui/backend/db_services/cmdb/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbbase/cluster/handlers.py b/dbm-ui/backend/db_services/dbbase/cluster/handlers.py index 47cb8c71db..0c22b0383b 100644 --- a/dbm-ui/backend/db_services/dbbase/cluster/handlers.py +++ b/dbm-ui/backend/db_services/dbbase/cluster/handlers.py @@ -14,7 +14,7 @@ from django.db.models import Prefetch from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import AccessLayer, ClusterType, InstanceInnerRole, InstanceStatus from backend.db_meta.exceptions import ClusterNotExistException, InstanceNotExistException diff --git a/dbm-ui/backend/db_services/dbbase/cluster/views.py b/dbm-ui/backend/db_services/dbbase/cluster/views.py index 38931546d6..b22ab420e5 100644 --- a/dbm-ui/backend/db_services/dbbase/cluster/views.py +++ b/dbm-ui/backend/db_services/dbbase/cluster/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbbase/constants.py b/dbm-ui/backend/db_services/dbbase/constants.py index 3bdce23045..2f64aab446 100644 --- a/dbm-ui/backend/db_services/dbbase/constants.py +++ b/dbm-ui/backend/db_services/dbbase/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/dbbase/instances/views.py b/dbm-ui/backend/db_services/dbbase/instances/views.py index de156beb9e..dc223e9f62 100644 --- a/dbm-ui/backend/db_services/dbbase/instances/views.py +++ b/dbm-ui/backend/db_services/dbbase/instances/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbbase/instances/yasg_slz.py b/dbm-ui/backend/db_services/dbbase/instances/yasg_slz.py index cbaa0e7590..14a680a2df 100644 --- a/dbm-ui/backend/db_services/dbbase/instances/yasg_slz.py +++ b/dbm-ui/backend/db_services/dbbase/instances/yasg_slz.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers diff --git a/dbm-ui/backend/db_services/dbbase/resources/constants.py b/dbm-ui/backend/db_services/dbbase/resources/constants.py index 214ed0341f..3113509795 100644 --- a/dbm-ui/backend/db_services/dbbase/resources/constants.py +++ b/dbm-ui/backend/db_services/dbbase/resources/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/dbbase/resources/query.py b/dbm-ui/backend/db_services/dbbase/resources/query.py index d963e05c30..5b2f0b26e8 100644 --- a/dbm-ui/backend/db_services/dbbase/resources/query.py +++ b/dbm-ui/backend/db_services/dbbase/resources/query.py @@ -17,7 +17,7 @@ from django.db.models import F, Prefetch, Q, QuerySet from django.http import HttpResponse from django.utils.http import urlquote -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterEntryType, ClusterType @@ -320,10 +320,9 @@ def _list_machines( raise NotImplementedError @classmethod - @abc.abstractmethod def get_topo_graph(cls, bk_biz_id: int, cluster_id: int) -> dict: """查询集群拓扑图. 具体方法在子类中实现""" - raise NotImplementedError + return {} @classmethod def get_fields(cls) -> List[Dict[str, str]]: diff --git a/dbm-ui/backend/db_services/dbbase/resources/register.py b/dbm-ui/backend/db_services/dbbase/resources/register.py index 081b18ea40..ec903897f0 100644 --- a/dbm-ui/backend/db_services/dbbase/resources/register.py +++ b/dbm-ui/backend/db_services/dbbase/resources/register.py @@ -13,6 +13,8 @@ import os from typing import Dict +from django.conf import settings + from backend.db_services.dbbase.resources.query import ListRetrieveResource logger = logging.getLogger("root") @@ -36,9 +38,10 @@ def decorator(cls: ListRetrieveResource): def register_all_resource(path="backend/db_services", module_path="backend.db_services"): """递归注册当前目录下所有的resource类""" - for name in os.listdir(path): - if os.path.isdir(os.path.join(path, name)): - register_all_resource(os.path.join(path, name), ".".join([module_path, name])) + abs_path = os.path.join(settings.BASE_DIR, path) + for name in os.listdir(abs_path): + if os.path.isdir(os.path.join(abs_path, name)): + register_all_resource(os.path.join(abs_path, name), ".".join([module_path, name])) # 所有的resource类都放在query.py文件下 elif name == "query.py": try: diff --git a/dbm-ui/backend/db_services/dbbase/resources/viewsets.py b/dbm-ui/backend/db_services/dbbase/resources/viewsets.py index 2a4acd95d2..395b6fd37b 100644 --- a/dbm-ui/backend/db_services/dbbase/resources/viewsets.py +++ b/dbm-ui/backend/db_services/dbbase/resources/viewsets.py @@ -13,6 +13,7 @@ from rest_framework.response import Response from backend.bk_web.viewsets import SystemViewSet +from backend.db_meta.api.cluster.base.handler import ClusterHandler from backend.iam_app.handlers.drf_perm.base import DBManagePermission from backend.iam_app.handlers.drf_perm.cluster import ClusterDetailPermission from backend.iam_app.handlers.permission import Permission @@ -134,5 +135,11 @@ def export_instance(self, request, bk_biz_id: int): bk_host_ids = request.data.get("bk_host_ids") return self.query_class.export_instance(bk_biz_id, bk_host_ids) + @action(methods=["POST"], detail=False, url_path="import_metadata") + def import_metadata(self, request, bk_biz_id: int): + """导入元数据""" + details = request.data.get("details") + return Response(ClusterHandler.import_meta(details)) + def _paginate_resource_list(self, request, bk_biz_id: int): return self.paginator.paginate_resource_list(request, bk_biz_id, self) diff --git a/dbm-ui/backend/db_services/dbbase/views.py b/dbm-ui/backend/db_services/dbbase/views.py index b3730c6850..4b6b83926f 100644 --- a/dbm-ui/backend/db_services/dbbase/views.py +++ b/dbm-ui/backend/db_services/dbbase/views.py @@ -12,7 +12,7 @@ from typing import Dict, List, Set, Union from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbconfig/exceptions.py b/dbm-ui/backend/db_services/dbconfig/exceptions.py index 1371ec755a..11a4d81d59 100644 --- a/dbm-ui/backend/db_services/dbconfig/exceptions.py +++ b/dbm-ui/backend/db_services/dbconfig/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/dbconfig/mock_data.py b/dbm-ui/backend/db_services/dbconfig/mock_data.py index ce2835cff7..ac7eaf81ac 100644 --- a/dbm-ui/backend/db_services/dbconfig/mock_data.py +++ b/dbm-ui/backend/db_services/dbconfig/mock_data.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. diff --git a/dbm-ui/backend/db_services/dbconfig/views.py b/dbm-ui/backend/db_services/dbconfig/views.py index f4fa94022d..ed3cde6eff 100644 --- a/dbm-ui/backend/db_services/dbconfig/views.py +++ b/dbm-ui/backend/db_services/dbconfig/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbpermission/constants.py b/dbm-ui/backend/db_services/dbpermission/constants.py index c9768b2f6b..1ab2cd9153 100644 --- a/dbm-ui/backend/db_services/dbpermission/constants.py +++ b/dbm-ui/backend/db_services/dbpermission/constants.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/dbpermission/db_account/handlers.py b/dbm-ui/backend/db_services/dbpermission/db_account/handlers.py index a9a0a3707c..506fbc59b0 100644 --- a/dbm-ui/backend/db_services/dbpermission/db_account/handlers.py +++ b/dbm-ui/backend/db_services/dbpermission/db_account/handlers.py @@ -13,7 +13,7 @@ from collections import defaultdict from typing import Any, Dict, List, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.mysql_priv_manager.client import DBPrivManagerApi from backend.core.encrypt.constants import AsymmetricCipherConfigType diff --git a/dbm-ui/backend/db_services/dbpermission/db_account/views.py b/dbm-ui/backend/db_services/dbpermission/db_account/views.py index b4d7210d4a..53565326e6 100644 --- a/dbm-ui/backend/db_services/dbpermission/db_account/views.py +++ b/dbm-ui/backend/db_services/dbpermission/db_account/views.py @@ -10,7 +10,7 @@ """ from typing import Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbpermission/db_authorize/models.py b/dbm-ui/backend/db_services/dbpermission/db_authorize/models.py index 4df52e223d..a8ee2939da 100644 --- a/dbm-ui/backend/db_services/dbpermission/db_authorize/models.py +++ b/dbm-ui/backend/db_services/dbpermission/db_authorize/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.ticket.models import Ticket diff --git a/dbm-ui/backend/db_services/dbpermission/db_authorize/views.py b/dbm-ui/backend/db_services/dbpermission/db_authorize/views.py index bdbf15e07c..9c6e49c100 100644 --- a/dbm-ui/backend/db_services/dbpermission/db_authorize/views.py +++ b/dbm-ui/backend/db_services/dbpermission/db_authorize/views.py @@ -11,7 +11,7 @@ from typing import Type, Union from django.http.response import HttpResponse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbresource/constants.py b/dbm-ui/backend/db_services/dbresource/constants.py index ebe3703001..1ae7318822 100644 --- a/dbm-ui/backend/db_services/dbresource/constants.py +++ b/dbm-ui/backend/db_services/dbresource/constants.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType from backend.db_services.dbresource.handlers import ( diff --git a/dbm-ui/backend/db_services/dbresource/exceptions.py b/dbm-ui/backend/db_services/dbresource/exceptions.py index 1728f4c16e..b9a9c83cc1 100644 --- a/dbm-ui/backend/db_services/dbresource/exceptions.py +++ b/dbm-ui/backend/db_services/dbresource/exceptions.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/dbresource/filters.py b/dbm-ui/backend/db_services/dbresource/filters.py index b441edc7be..df56f140ff 100644 --- a/dbm-ui/backend/db_services/dbresource/filters.py +++ b/dbm-ui/backend/db_services/dbresource/filters.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters import rest_framework as filters from backend.db_meta.models.spec import Spec diff --git a/dbm-ui/backend/db_services/dbresource/handlers.py b/dbm-ui/backend/db_services/dbresource/handlers.py index 1edf025640..294a2dd988 100644 --- a/dbm-ui/backend/db_services/dbresource/handlers.py +++ b/dbm-ui/backend/db_services/dbresource/handlers.py @@ -13,7 +13,7 @@ from typing import Any, Dict, List from django.forms import model_to_dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.dbresource.client import DBResourceApi from backend.db_meta.enums import ClusterType, MachineType diff --git a/dbm-ui/backend/db_services/dbresource/serializers.py b/dbm-ui/backend/db_services/dbresource/serializers.py index 937db0f910..5c8c6e682f 100644 --- a/dbm-ui/backend/db_services/dbresource/serializers.py +++ b/dbm-ui/backend/db_services/dbresource/serializers.py @@ -10,7 +10,7 @@ """ from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend import env diff --git a/dbm-ui/backend/db_services/dbresource/views/resource.py b/dbm-ui/backend/db_services/dbresource/views/resource.py index eaa6ae169f..dff376ca57 100644 --- a/dbm-ui/backend/db_services/dbresource/views/resource.py +++ b/dbm-ui/backend/db_services/dbresource/views/resource.py @@ -13,7 +13,7 @@ import time from typing import Dict, List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/dbresource/views/sepc.py b/dbm-ui/backend/db_services/dbresource/views/sepc.py index 8bbccc696a..2b3f194874 100644 --- a/dbm-ui/backend/db_services/dbresource/views/sepc.py +++ b/dbm-ui/backend/db_services/dbresource/views/sepc.py @@ -11,7 +11,7 @@ import math from django.db.models import F, Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/group/views.py b/dbm-ui/backend/db_services/group/views.py index de3c40689b..d855c68a99 100644 --- a/dbm-ui/backend/db_services/group/views.py +++ b/dbm-ui/backend/db_services/group/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/infras/host.py b/dbm-ui/backend/db_services/infras/host.py index 1875788c5f..217ff92769 100644 --- a/dbm-ui/backend/db_services/infras/host.py +++ b/dbm-ui/backend/db_services/infras/host.py @@ -12,7 +12,7 @@ from typing import Dict, List import humanize -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.models import LogicalCity from backend.db_services.dbbase.constants import IpSource diff --git a/dbm-ui/backend/db_services/infras/serializers.py b/dbm-ui/backend/db_services/infras/serializers.py index 1b4cd5eb94..9bff6a4f5f 100644 --- a/dbm-ui/backend/db_services/infras/serializers.py +++ b/dbm-ui/backend/db_services/infras/serializers.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/db_services/infras/views.py b/dbm-ui/backend/db_services/infras/views.py index 036e716a49..9ec8ee7615 100644 --- a/dbm-ui/backend/db_services/infras/views.py +++ b/dbm-ui/backend/db_services/infras/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/ipchooser/constants.py b/dbm-ui/backend/db_services/ipchooser/constants.py index dbcf2f0f31..99cc0010a2 100644 --- a/dbm-ui/backend/db_services/ipchooser/constants.py +++ b/dbm-ui/backend/db_services/ipchooser/constants.py @@ -11,7 +11,7 @@ from enum import Enum from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.utils import env from backend.utils.basic import choices_to_namedtuple, tuple_choices diff --git a/dbm-ui/backend/db_services/ipchooser/exceptions.py b/dbm-ui/backend/db_services/ipchooser/exceptions.py index 0b84d579b0..8ce100c552 100644 --- a/dbm-ui/backend/db_services/ipchooser/exceptions.py +++ b/dbm-ui/backend/db_services/ipchooser/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.core.exceptions import CoreBaseException diff --git a/dbm-ui/backend/db_services/ipchooser/mock_data.py b/dbm-ui/backend/db_services/ipchooser/mock_data.py index f6dfa38de6..e4abbe2488 100644 --- a/dbm-ui/backend/db_services/ipchooser/mock_data.py +++ b/dbm-ui/backend/db_services/ipchooser/mock_data.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. diff --git a/dbm-ui/backend/db_services/ipchooser/query/resource.py b/dbm-ui/backend/db_services/ipchooser/query/resource.py index 2dfc43f161..873b25a569 100644 --- a/dbm-ui/backend/db_services/ipchooser/query/resource.py +++ b/dbm-ui/backend/db_services/ipchooser/query/resource.py @@ -15,7 +15,7 @@ from typing import Any, Dict, List, Union from django.core.cache import cache -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.bk_web.constants import CACHE_1D diff --git a/dbm-ui/backend/db_services/ipchooser/serializers/base.py b/dbm-ui/backend/db_services/ipchooser/serializers/base.py index 54e52baef6..7ed4ea1282 100644 --- a/dbm-ui/backend/db_services/ipchooser/serializers/base.py +++ b/dbm-ui/backend/db_services/ipchooser/serializers/base.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from .. import constants, exceptions diff --git a/dbm-ui/backend/db_services/ipchooser/serializers/host_sers.py b/dbm-ui/backend/db_services/ipchooser/serializers/host_sers.py index d9a57066ad..1a33614901 100644 --- a/dbm-ui/backend/db_services/ipchooser/serializers/host_sers.py +++ b/dbm-ui/backend/db_services/ipchooser/serializers/host_sers.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from .. import constants, mock_data diff --git a/dbm-ui/backend/db_services/ipchooser/serializers/topo_sers.py b/dbm-ui/backend/db_services/ipchooser/serializers/topo_sers.py index 69db7fbf99..544a68668c 100644 --- a/dbm-ui/backend/db_services/ipchooser/serializers/topo_sers.py +++ b/dbm-ui/backend/db_services/ipchooser/serializers/topo_sers.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from .. import constants, mock_data diff --git a/dbm-ui/backend/db_services/ipchooser/views.py b/dbm-ui/backend/db_services/ipchooser/views.py index 06a6b89120..649883c640 100644 --- a/dbm-ui/backend/db_services/ipchooser/views.py +++ b/dbm-ui/backend/db_services/ipchooser/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from drf_yasg.utils import swagger_auto_schema from rest_framework import status from rest_framework.decorators import action diff --git a/dbm-ui/backend/db_services/meta_import/constants.py b/dbm-ui/backend/db_services/meta_import/constants.py index f3e0c0e61e..52cb6a416e 100644 --- a/dbm-ui/backend/db_services/meta_import/constants.py +++ b/dbm-ui/backend/db_services/meta_import/constants.py @@ -8,6 +8,6 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ SWAGGER_TAG = _("元数据迁移") diff --git a/dbm-ui/backend/db_services/meta_import/serializers.py b/dbm-ui/backend/db_services/meta_import/serializers.py index 097336e581..88d468ac30 100644 --- a/dbm-ui/backend/db_services/meta_import/serializers.py +++ b/dbm-ui/backend/db_services/meta_import/serializers.py @@ -9,13 +9,21 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers +from backend.constants import DEFAULT_BK_CLOUD_ID from backend.db_meta.enums import ClusterType, MachineType from backend.db_meta.models import AppCache, DBModule, Spec +class GeneralMetadataImportSerializer(serializers.Serializer): + bk_biz_id = serializers.IntegerField(help_text=_("业务ID")) + bk_cloud_id = serializers.IntegerField(help_text=_("云区域ID"), required=False, default=DEFAULT_BK_CLOUD_ID) + cluster_type = serializers.ChoiceField(help_text=_("集群类型"), choices=ClusterType.get_choices()) + details = serializers.ListField(child=serializers.DictField(), help_text=_("导入元数据详情")) + + class CustomChoiceField(serializers.ChoiceField): def __init__(self, choices, **kwargs): super().__init__(choices, **kwargs) diff --git a/dbm-ui/backend/db_services/meta_import/urls.py b/dbm-ui/backend/db_services/meta_import/urls.py index 0db1904a6f..b7e9dbef6b 100644 --- a/dbm-ui/backend/db_services/meta_import/urls.py +++ b/dbm-ui/backend/db_services/meta_import/urls.py @@ -13,6 +13,6 @@ from backend.db_services.meta_import.views import DBMetadataImportViewSet routers = DefaultRouter(trailing_slash=True) -routers.register("", DBMetadataImportViewSet, basename="partition") +routers.register("", DBMetadataImportViewSet, basename="meta_import") urlpatterns = routers.urls diff --git a/dbm-ui/backend/db_services/meta_import/views.py b/dbm-ui/backend/db_services/meta_import/views.py index 2ab553d473..b0eb9cf707 100644 --- a/dbm-ui/backend/db_services/meta_import/views.py +++ b/dbm-ui/backend/db_services/meta_import/views.py @@ -11,8 +11,7 @@ import json import logging -from django.utils.translation import ugettext_lazy as _ -from rest_framework import serializers +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.parsers import MultiPartParser from rest_framework.response import Response @@ -23,14 +22,9 @@ from backend.configuration.models import SystemSettings from backend.db_meta.enums import ClusterType from backend.db_meta.models import Cluster +from backend.db_services.meta_import import serializers from backend.db_services.meta_import.constants import SWAGGER_TAG -from backend.db_services.meta_import.serializers import ( - TenDBClusterAppendCTLSerializer, - TenDBClusterMetadataImportSerializer, - TenDBClusterStandardizeSerializer, - TenDBHAMetadataImportSerializer, - TenDBHAStandardizeSerializer, -) +from backend.exceptions import ValidationError from backend.iam_app.handlers.drf_perm.base import RejectPermission from backend.ticket.builders.mysql.mysql_ha_metadata_import import TenDBHAMetadataImportDetailSerializer from backend.ticket.builders.mysql.mysql_ha_standardize import TenDBHAStandardizeDetailSerializer @@ -53,6 +47,16 @@ def _get_custom_permissions(self): return [] return [RejectPermission()] + @common_swagger_auto_schema(operation_summary=_("通用元数据导入"), tags=[SWAGGER_TAG]) + @action( + methods=["POST"], + detail=False, + serializer_class=serializers.GeneralMetadataImportSerializer, + ) + def general_metadata_import(self, request, *args, **kwargs): + data = self.params_validate(self.get_serializer_class()) + return Response(data) + @common_swagger_auto_schema( operation_summary=_("TenDB HA 元数据导入"), tags=[SWAGGER_TAG], @@ -60,7 +64,7 @@ def _get_custom_permissions(self): @action( methods=["POST"], detail=False, - serializer_class=TenDBHAMetadataImportSerializer, + serializer_class=serializers.TenDBHAMetadataImportSerializer, parser_classes=[MultiPartParser], ) def tendbha_metadata_import(self, request, *args, **kwargs): @@ -85,7 +89,7 @@ def tendbha_metadata_import(self, request, *args, **kwargs): @action( methods=["POST"], detail=False, - serializer_class=TenDBHAStandardizeSerializer, + serializer_class=serializers.TenDBHAStandardizeSerializer, parser_classes=[MultiPartParser], ) def tendbha_standardize(self, request, *args, **kwargs): @@ -109,7 +113,7 @@ def tendbha_standardize(self, request, *args, **kwargs): ) diff = list(set(domain_list) - set(exists_domains)) if diff: - raise serializers.ValidationError(_("cluster {} not found".format(diff))) + raise ValidationError(_("cluster {} not found".format(diff))) data["cluster_ids"] = cluster_ids @@ -132,7 +136,7 @@ def tendbha_standardize(self, request, *args, **kwargs): @action( methods=["POST"], detail=False, - serializer_class=TenDBClusterMetadataImportSerializer, + serializer_class=serializers.TenDBClusterMetadataImportSerializer, parser_classes=[MultiPartParser], ) def tendbcluster_metadata_import(self, request, *args, **kwargs): @@ -155,7 +159,7 @@ def tendbcluster_metadata_import(self, request, *args, **kwargs): @action( methods=["POST"], detail=False, - serializer_class=TenDBClusterStandardizeSerializer, + serializer_class=serializers.TenDBClusterStandardizeSerializer, parser_classes=[MultiPartParser], ) def tendbcluster_standardize(self, request, *args, **kwargs): @@ -179,7 +183,7 @@ def tendbcluster_standardize(self, request, *args, **kwargs): ) diff = list(set(domain_list) - set(exists_domains)) if diff: - raise serializers.ValidationError(_("cluster {} not found".format(diff))) + raise ValidationError(_("cluster {} not found".format(diff))) data["cluster_ids"] = cluster_ids @@ -202,7 +206,7 @@ def tendbcluster_standardize(self, request, *args, **kwargs): @action( methods=["POST"], detail=False, - serializer_class=TenDBClusterAppendCTLSerializer, + serializer_class=serializers.TenDBClusterAppendCTLSerializer, parser_classes=[MultiPartParser], ) def tendbcluster_append_deploy_ctl(self, request, *args, **kwargs): diff --git a/dbm-ui/backend/db_services/mongodb/permission/db_authorize/handlers.py b/dbm-ui/backend/db_services/mongodb/permission/db_authorize/handlers.py index acbd7c54ae..cd4a67072c 100644 --- a/dbm-ui/backend/db_services/mongodb/permission/db_authorize/handlers.py +++ b/dbm-ui/backend/db_services/mongodb/permission/db_authorize/handlers.py @@ -11,7 +11,7 @@ import base64 from typing import Dict, List, Tuple -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.components.mysql_priv_manager.client import DBPrivManagerApi from backend.db_services.dbpermission.constants import AccountType, AuthorizeExcelHeader diff --git a/dbm-ui/backend/db_services/mongodb/permission/db_authorize/views.py b/dbm-ui/backend/db_services/mongodb/permission/db_authorize/views.py index eb4298cf47..990d861d3c 100644 --- a/dbm-ui/backend/db_services/mongodb/permission/db_authorize/views.py +++ b/dbm-ui/backend/db_services/mongodb/permission/db_authorize/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action diff --git a/dbm-ui/backend/db_services/mongodb/resources/query.py b/dbm-ui/backend/db_services/mongodb/resources/query.py index 3b3cbd0140..4572622e6e 100644 --- a/dbm-ui/backend/db_services/mongodb/resources/query.py +++ b/dbm-ui/backend/db_services/mongodb/resources/query.py @@ -12,7 +12,7 @@ from django.db.models import CharField, ExpressionWrapper, F, Q, QuerySet, Value from django.db.models.functions import Concat -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterType, MachineType from backend.db_meta.models.cluster import Cluster diff --git a/dbm-ui/backend/db_services/mongodb/resources/views.py b/dbm-ui/backend/db_services/mongodb/resources/views.py index 5db7fca38c..c1c6117d76 100644 --- a/dbm-ui/backend/db_services/mongodb/resources/views.py +++ b/dbm-ui/backend/db_services/mongodb/resources/views.py @@ -10,7 +10,7 @@ """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mongodb/restore/handlers.py b/dbm-ui/backend/db_services/mongodb/restore/handlers.py index 0bc7e30696..4e4c7f55b6 100644 --- a/dbm-ui/backend/db_services/mongodb/restore/handlers.py +++ b/dbm-ui/backend/db_services/mongodb/restore/handlers.py @@ -13,7 +13,7 @@ from typing import Any, Dict, List from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.bklog.handler import BKLogHandler from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_services/mongodb/restore/serializers.py b/dbm-ui/backend/db_services/mongodb/restore/serializers.py index 59951eb96f..a36436181e 100644 --- a/dbm-ui/backend/db_services/mongodb/restore/serializers.py +++ b/dbm-ui/backend/db_services/mongodb/restore/serializers.py @@ -10,7 +10,7 @@ """ from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_services/mongodb/restore/views.py b/dbm-ui/backend/db_services/mongodb/restore/views.py index 882a7c0787..59bb2bdaa3 100644 --- a/dbm-ui/backend/db_services/mongodb/restore/views.py +++ b/dbm-ui/backend/db_services/mongodb/restore/views.py @@ -11,7 +11,7 @@ from datetime import datetime, timedelta from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/cluster/views.py b/dbm-ui/backend/db_services/mysql/cluster/views.py index f2bee66adc..c7caf68e6d 100644 --- a/dbm-ui/backend/db_services/mysql/cluster/views.py +++ b/dbm-ui/backend/db_services/mysql/cluster/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/dumper/filters.py b/dbm-ui/backend/db_services/mysql/dumper/filters.py index df6ddaba3a..bc9ef5d6cc 100644 --- a/dbm-ui/backend/db_services/mysql/dumper/filters.py +++ b/dbm-ui/backend/db_services/mysql/dumper/filters.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters import rest_framework as filters from django_mysql.models.functions import JSONExtract diff --git a/dbm-ui/backend/db_services/mysql/dumper/models.py b/dbm-ui/backend/db_services/mysql/dumper/models.py index 05668e18ad..7326b69a63 100644 --- a/dbm-ui/backend/db_services/mysql/dumper/models.py +++ b/dbm-ui/backend/db_services/mysql/dumper/models.py @@ -12,7 +12,7 @@ import logging from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.flow.consts import TBinlogDumperAddType diff --git a/dbm-ui/backend/db_services/mysql/dumper/views/dumper_config.py b/dbm-ui/backend/db_services/mysql/dumper/views/dumper_config.py index 1d1e9ab9bd..58ddbe38cf 100644 --- a/dbm-ui/backend/db_services/mysql/dumper/views/dumper_config.py +++ b/dbm-ui/backend/db_services/mysql/dumper/views/dumper_config.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/dumper/views/dumper_instance.py b/dbm-ui/backend/db_services/mysql/dumper/views/dumper_instance.py index 77c209b014..6f43e4d7ad 100644 --- a/dbm-ui/backend/db_services/mysql/dumper/views/dumper_instance.py +++ b/dbm-ui/backend/db_services/mysql/dumper/views/dumper_instance.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.bk_web import viewsets from backend.bk_web.pagination import AuditedLimitOffsetPagination diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py index bd087da111..d9a87c7977 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/handlers.py @@ -18,7 +18,7 @@ from django.conf import settings from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from backend import env diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/serializers.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/serializers.py index 2ffb70841f..db5055e467 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/serializers.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.mysql.fixpoint_rollback.constants import BACKUP_LOG_RANGE_DAYS diff --git a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py index 8ff81270fb..141879730a 100644 --- a/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py +++ b/dbm-ui/backend/db_services/mysql/fixpoint_rollback/views.py @@ -12,7 +12,7 @@ from typing import Any, Dict, List from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/open_area/exceptions.py b/dbm-ui/backend/db_services/mysql/open_area/exceptions.py index 611e92078a..09ccd4379a 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/exceptions.py +++ b/dbm-ui/backend/db_services/mysql/open_area/exceptions.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/mysql/open_area/filters.py b/dbm-ui/backend/db_services/mysql/open_area/filters.py index 4a11d3bdc1..28041393b4 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/filters.py +++ b/dbm-ui/backend/db_services/mysql/open_area/filters.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django_filters import rest_framework as filters from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig diff --git a/dbm-ui/backend/db_services/mysql/open_area/handlers.py b/dbm-ui/backend/db_services/mysql/open_area/handlers.py index dba8ba232b..b3196518b2 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/handlers.py +++ b/dbm-ui/backend/db_services/mysql/open_area/handlers.py @@ -13,7 +13,7 @@ from collections import defaultdict from typing import Any, Dict, List, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBPrivManagerApi from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_services/mysql/open_area/models.py b/dbm-ui/backend/db_services/mysql/open_area/models.py index ee75ba433a..d0f05a5b14 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/models.py +++ b/dbm-ui/backend/db_services/mysql/open_area/models.py @@ -9,7 +9,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_services/mysql/open_area/serializers.py b/dbm-ui/backend/db_services/mysql/open_area/serializers.py index 6f70ea2c53..d7046a2c4f 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/serializers.py +++ b/dbm-ui/backend/db_services/mysql/open_area/serializers.py @@ -11,7 +11,7 @@ import itertools -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.bk_web.serializers import AuditedSerializer diff --git a/dbm-ui/backend/db_services/mysql/open_area/views.py b/dbm-ui/backend/db_services/mysql/open_area/views.py index 048d185fd5..8b9808a572 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/views.py +++ b/dbm-ui/backend/db_services/mysql/open_area/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/permission/authorize/handlers.py b/dbm-ui/backend/db_services/mysql/permission/authorize/handlers.py index 3ba9e27a19..555f717c24 100644 --- a/dbm-ui/backend/db_services/mysql/permission/authorize/handlers.py +++ b/dbm-ui/backend/db_services/mysql/permission/authorize/handlers.py @@ -13,7 +13,7 @@ from typing import Dict, List, Tuple from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.components.gcs.client import GcsApi diff --git a/dbm-ui/backend/db_services/mysql/permission/authorize/views.py b/dbm-ui/backend/db_services/mysql/permission/authorize/views.py index 1df6b9b576..b8e5b1c454 100644 --- a/dbm-ui/backend/db_services/mysql/permission/authorize/views.py +++ b/dbm-ui/backend/db_services/mysql/permission/authorize/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from backend.bk_web.swagger import common_swagger_auto_schema diff --git a/dbm-ui/backend/db_services/mysql/permission/clone/handlers.py b/dbm-ui/backend/db_services/mysql/permission/clone/handlers.py index ecf849ced9..86344a9c3c 100644 --- a/dbm-ui/backend/db_services/mysql/permission/clone/handlers.py +++ b/dbm-ui/backend/db_services/mysql/permission/clone/handlers.py @@ -13,7 +13,7 @@ from django.core.cache import cache from django.http.response import HttpResponse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.components.mysql_priv_manager.client import DBPrivManagerApi diff --git a/dbm-ui/backend/db_services/mysql/permission/clone/models.py b/dbm-ui/backend/db_services/mysql/permission/clone/models.py index 2723cc0063..6071c45784 100644 --- a/dbm-ui/backend/db_services/mysql/permission/clone/models.py +++ b/dbm-ui/backend/db_services/mysql/permission/clone/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_NORMAL, LEN_SHORT from backend.db_services.mysql.permission.constants import CloneType diff --git a/dbm-ui/backend/db_services/mysql/permission/clone/views.py b/dbm-ui/backend/db_services/mysql/permission/clone/views.py index 0677166c14..c0d55d4a9b 100644 --- a/dbm-ui/backend/db_services/mysql/permission/clone/views.py +++ b/dbm-ui/backend/db_services/mysql/permission/clone/views.py @@ -11,7 +11,7 @@ from typing import Type, Union from django.http.response import HttpResponse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/permission/constants.py b/dbm-ui/backend/db_services/mysql/permission/constants.py index 2b1b0dcf08..b2f1a20d6b 100644 --- a/dbm-ui/backend/db_services/mysql/permission/constants.py +++ b/dbm-ui/backend/db_services/mysql/permission/constants.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py index 1b86a57444..c6294fcc25 100644 --- a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py +++ b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_services.dbpermission.constants import PrivilegeType from backend.db_services.dbpermission.db_account.handlers import AccountHandler diff --git a/dbm-ui/backend/db_services/mysql/permission/exceptions.py b/dbm-ui/backend/db_services/mysql/permission/exceptions.py index 49fea86ee9..55f3f973f5 100644 --- a/dbm-ui/backend/db_services/mysql/permission/exceptions.py +++ b/dbm-ui/backend/db_services/mysql/permission/exceptions.py @@ -11,7 +11,7 @@ import functools import types -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/mysql/remote_service/exceptions.py b/dbm-ui/backend/db_services/mysql/remote_service/exceptions.py index 5c725e1e8e..2b8fd7ddb2 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/exceptions.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/exceptions.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/mysql/remote_service/handlers.py b/dbm-ui/backend/db_services/mysql/remote_service/handlers.py index dbd2748e44..833eb5b2a8 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/handlers.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/handlers.py @@ -11,7 +11,7 @@ from collections import defaultdict from typing import Any, Dict, List, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.db_meta.api.cluster.base.handler import ClusterHandler diff --git a/dbm-ui/backend/db_services/mysql/remote_service/views.py b/dbm-ui/backend/db_services/mysql/remote_service/views.py index 511511112f..b14be93844 100644 --- a/dbm-ui/backend/db_services/mysql/remote_service/views.py +++ b/dbm-ui/backend/db_services/mysql/remote_service/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/__init__.py b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/query.py b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/query.py new file mode 100644 index 0000000000..6a3a233f59 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/query.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" + +from backend.db_meta.enums.cluster_type import ClusterType +from backend.db_services.dbbase.resources import query +from backend.db_services.dbbase.resources.register import register_resource_decorator + + +@register_resource_decorator() +class ListRetrieveResource(query.ListRetrieveResource): + """查看 mysql 单点部署的资源""" + + cluster_types = [ClusterType.MySQLOnK8S] diff --git a/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/views.py b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/views.py new file mode 100644 index 0000000000..ff90837adc --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/views.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.utils.decorators import method_decorator +from rest_framework import status + +from backend.bk_web.swagger import common_swagger_auto_schema +from backend.configuration.constants import DBType +from backend.db_services.dbbase.resources import serializers, viewsets +from backend.db_services.mysql.resources import constants +from backend.iam_app.dataclass.actions import ActionEnum + +from . import yasg_slz +from .query import ListRetrieveResource + + +@method_decorator( + name="list", + decorator=common_swagger_auto_schema( + query_serializer=serializers.ListMySQLResourceSLZ(), + responses={status.HTTP_200_OK: yasg_slz.PaginatedResourceSLZ()}, + tags=[constants.RESOURCE_TAG], + ), +) +@method_decorator( + name="retrieve", + decorator=common_swagger_auto_schema( + responses={status.HTTP_200_OK: yasg_slz.ResourceSLZ()}, + tags=[constants.RESOURCE_TAG], + ), +) +class MySQLOnK8SViewSet(viewsets.ResourceViewSet): + """查询单点部署资源""" + + db_type = DBType.MySQL + query_class = ListRetrieveResource + query_serializer_class = serializers.ListMySQLResourceSLZ + + list_perm_actions = [ + ActionEnum.MYSQL_ENABLE_DISABLE, + ActionEnum.MYSQL_DESTROY, + ActionEnum.MYSQL_VIEW, + ] + list_instance_perm_actions = [ActionEnum.MYSQL_VIEW] + list_external_perm_actions = [ActionEnum.ACCESS_ENTRY_EDIT] + + @staticmethod + def _external_perm_param_field(kwargs): + return kwargs["view_class"].db_type diff --git a/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/yasg_slz.py b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/yasg_slz.py new file mode 100644 index 0000000000..cd7048dc71 --- /dev/null +++ b/dbm-ui/backend/db_services/mysql/resources/mysqlonk8s/yasg_slz.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from rest_framework import serializers + +REF_NAME = "mysqlonk8s" + +paginated_resource_example = { + "count": 10, + "next": "http://xxxxx?limit=5&offset=10", + "previous": "http://xxxxx?limit=5&offset=10", + "results": [ + { + "cluster_name": "bk-dbm", + "master_domain": "gamedb.bk-dbm.blueking.db", + "masters": ["0.0.0.1#30000"], + "...": "...", + } + ], +} + + +class PaginatedResourceSLZ(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": paginated_resource_example} + ref_name = f"{REF_NAME}_PaginatedResourceSLZ" + + +class ResourceSLZ(serializers.Serializer): + class Meta: + swagger_schema_fields = {"example": paginated_resource_example["results"][0]} + ref_name = f"{REF_NAME}_ResourceSLZ" diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py index f89baac385..460b4b3bd4 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py @@ -13,7 +13,7 @@ from django.db.models import F, Q, Value from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.tendbcluster.detail import scan_cluster from backend.db_meta.enums import InstanceInnerRole, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py index e167aa11ed..4181f744b3 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbha/query.py @@ -11,7 +11,7 @@ from typing import Any, Callable, Dict, List from django.db.models import F, Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.tendbha.detail import scan_cluster from backend.db_meta.enums import InstanceInnerRole diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py index 4ee84d5275..e98a05ac7c 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbsingle/query.py @@ -11,7 +11,7 @@ from typing import Any, Dict, List from django.db.models import F -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.api.cluster.tendbsingle.detail import scan_cluster from backend.db_meta.enums import InstanceInnerRole diff --git a/dbm-ui/backend/db_services/mysql/resources/urls.py b/dbm-ui/backend/db_services/mysql/resources/urls.py index 902625f7c8..b158dd8c95 100644 --- a/dbm-ui/backend/db_services/mysql/resources/urls.py +++ b/dbm-ui/backend/db_services/mysql/resources/urls.py @@ -11,6 +11,7 @@ from django.urls import path from rest_framework.routers import DefaultRouter +from .mysqlonk8s.views import MySQLOnK8SViewSet from .tendbcluster.views import SpiderViewSet from .tendbha.views import DBHAViewSet from .tendbsingle.views import DBSingleViewSet @@ -21,6 +22,7 @@ router.register(r"tendbha_resources", DBHAViewSet, basename="tendbha_resource") router.register(r"tendbsingle_resources", DBSingleViewSet, basename="tendbsingle_resource") router.register(r"spider_resources", SpiderViewSet, basename="spider_resource") +router.register(r"mysqlonk8s_resources", MySQLOnK8SViewSet, basename="mysqlonk8s_resources") urlpatterns = [ # 提供资源(集群)通用属性的查询, 如集群名, 集群创建者等 diff --git a/dbm-ui/backend/db_services/mysql/resources/views.py b/dbm-ui/backend/db_services/mysql/resources/views.py index 0dfc23b402..8142db24ba 100644 --- a/dbm-ui/backend/db_services/mysql/resources/views.py +++ b/dbm-ui/backend/db_services/mysql/resources/views.py @@ -11,7 +11,7 @@ from collections import defaultdict from django.utils.decorators import method_decorator -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/mysql/sql_import/exceptions.py b/dbm-ui/backend/db_services/mysql/sql_import/exceptions.py index dd85e9ea14..861a2315a7 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/exceptions.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/exceptions.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/mysql/sql_import/handlers.py b/dbm-ui/backend/db_services/mysql/sql_import/handlers.py index 13a70bba2c..5be89c2c10 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/handlers.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/handlers.py @@ -15,7 +15,7 @@ from django.core.cache import cache from django.core.files.uploadedfile import InMemoryUploadedFile -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.sql_import.client import SQLSimulationApi from backend.configuration.constants import PLAT_BIZ_ID, DBType diff --git a/dbm-ui/backend/db_services/mysql/sql_import/mock_data.py b/dbm-ui/backend/db_services/mysql/sql_import/mock_data.py index 92acd45ee5..f6f8e1241f 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/mock_data.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/mock_data.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ SQL_GRAMMAR_CHECK_REQUEST_DATA = {"sql_content": "select * from user where user.id = 1", "sql_file": None} SQL_GRAMMAR_CHECK_RESPONSE_DATA = { diff --git a/dbm-ui/backend/db_services/mysql/sql_import/views.py b/dbm-ui/backend/db_services/mysql/sql_import/views.py index 90868c8d85..dec7085f37 100644 --- a/dbm-ui/backend/db_services/mysql/sql_import/views.py +++ b/dbm-ui/backend/db_services/mysql/sql_import/views.py @@ -10,7 +10,7 @@ """ from typing import Type, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/partition/constants.py b/dbm-ui/backend/db_services/partition/constants.py index 4bb55c8d06..739198f339 100644 --- a/dbm-ui/backend/db_services/partition/constants.py +++ b/dbm-ui/backend/db_services/partition/constants.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/partition/exceptions.py b/dbm-ui/backend/db_services/partition/exceptions.py index 40d91fdfdb..808946bdd7 100644 --- a/dbm-ui/backend/db_services/partition/exceptions.py +++ b/dbm-ui/backend/db_services/partition/exceptions.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/partition/handlers.py b/dbm-ui/backend/db_services/partition/handlers.py index a935a4a33c..ab7a716289 100644 --- a/dbm-ui/backend/db_services/partition/handlers.py +++ b/dbm-ui/backend/db_services/partition/handlers.py @@ -12,7 +12,7 @@ from typing import Any, Dict, List, Union from django.forms import model_to_dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.components.mysql_partition.client import DBPartitionApi diff --git a/dbm-ui/backend/db_services/partition/serializers.py b/dbm-ui/backend/db_services/partition/serializers.py index 3930f90380..511fbed4bf 100644 --- a/dbm-ui/backend/db_services/partition/serializers.py +++ b/dbm-ui/backend/db_services/partition/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/db_services/partition/views.py b/dbm-ui/backend/db_services/partition/views.py index 8a8c3dd9e4..3fb23a39bf 100644 --- a/dbm-ui/backend/db_services/partition/views.py +++ b/dbm-ui/backend/db_services/partition/views.py @@ -11,7 +11,7 @@ from functools import wraps -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/plugin/mysql/authorize/views.py b/dbm-ui/backend/db_services/plugin/mysql/authorize/views.py index 690e92118a..ebf1e91ed2 100644 --- a/dbm-ui/backend/db_services/plugin/mysql/authorize/views.py +++ b/dbm-ui/backend/db_services/plugin/mysql/authorize/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/quick_search/constants.py b/dbm-ui/backend/db_services/quick_search/constants.py index e6275b8ee4..a0e03f4d76 100644 --- a/dbm-ui/backend/db_services/quick_search/constants.py +++ b/dbm-ui/backend/db_services/quick_search/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/quick_search/serializers.py b/dbm-ui/backend/db_services/quick_search/serializers.py index c1c4b73954..fa2afced6d 100644 --- a/dbm-ui/backend/db_services/quick_search/serializers.py +++ b/dbm-ui/backend/db_services/quick_search/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/db_services/quick_search/views.py b/dbm-ui/backend/db_services/quick_search/views.py index 25e89fd4f4..9445edbccc 100644 --- a/dbm-ui/backend/db_services/quick_search/views.py +++ b/dbm-ui/backend/db_services/quick_search/views.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/redis/autofix/bill.py b/dbm-ui/backend/db_services/redis/autofix/bill.py index 7f7e70390e..4a0c295713 100644 --- a/dbm-ui/backend/db_services/redis/autofix/bill.py +++ b/dbm-ui/backend/db_services/redis/autofix/bill.py @@ -15,7 +15,7 @@ from django.db.models import QuerySet from django.utils import timezone from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from backend.configuration.models.dba import DBAdministrator diff --git a/dbm-ui/backend/db_services/redis/autofix/enums.py b/dbm-ui/backend/db_services/redis/autofix/enums.py index f55d98d479..0742f4fe3d 100644 --- a/dbm-ui/backend/db_services/redis/autofix/enums.py +++ b/dbm-ui/backend/db_services/redis/autofix/enums.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/redis/autofix/models.py b/dbm-ui/backend/db_services/redis/autofix/models.py index c48f9d23e2..ef5f48db51 100644 --- a/dbm-ui/backend/db_services/redis/autofix/models.py +++ b/dbm-ui/backend/db_services/redis/autofix/models.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.constants import LEN_LONG, LEN_NORMAL, LEN_XX_LONG from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/db_services/redis/constants.py b/dbm-ui/backend/db_services/redis/constants.py index 5576ff9ccb..e3ad59b7d1 100644 --- a/dbm-ui/backend/db_services/redis/constants.py +++ b/dbm-ui/backend/db_services/redis/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/redis/redis_dts/constants.py b/dbm-ui/backend/db_services/redis/redis_dts/constants.py index 1906d01fed..5f2e94a88b 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/constants.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/constants.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/db_services/redis/redis_dts/exceptions.py b/dbm-ui/backend/db_services/redis/redis_dts/exceptions.py index 89a27cff4f..03fbd0967c 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/exceptions.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/redis/redis_dts/migrate_cluster_password.py b/dbm-ui/backend/db_services/redis/redis_dts/migrate_cluster_password.py index bbf6540833..04eec1c3bf 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/migrate_cluster_password.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/migrate_cluster_password.py @@ -11,7 +11,7 @@ import base64 -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBPrivManagerApi from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_distribute_lock.py b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_distribute_lock.py index 7ec1b2e8ce..08e971607d 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_distribute_lock.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_distribute_lock.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class TbTendisDtsDistributeLock(models.Model): diff --git a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_server.py b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_server.py index 1308f47f99..0d4ebcf3a7 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_server.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_dts_server.py @@ -10,7 +10,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class TendisDtsServer(models.Model): diff --git a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_job.py b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_job.py index 2c9bae41df..cb298574b5 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_job.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_job.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_services.redis.redis_dts.enums import ( DtsBillType, diff --git a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_task.py b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_task.py index e467ffc25b..2ef9c4796f 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_task.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/models/tb_tendis_dts_task.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_services.redis.redis_dts.enums import DtsWriteMode from backend.utils.time import datetime2str diff --git a/dbm-ui/backend/db_services/redis/redis_dts/util.py b/dbm-ui/backend/db_services/redis/redis_dts/util.py index d143c4869b..12b879842a 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/util.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/util.py @@ -17,7 +17,7 @@ from typing import Dict, List, Tuple from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/db_services/redis/redis_dts/views.py b/dbm-ui/backend/db_services/redis/redis_dts/views.py index b162ad6c2f..ec7816f803 100644 --- a/dbm-ui/backend/db_services/redis/redis_dts/views.py +++ b/dbm-ui/backend/db_services/redis/redis_dts/views.py @@ -10,7 +10,7 @@ """ import logging.config -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py b/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py index 773a07fd0f..f8d1ea73e8 100644 --- a/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py +++ b/dbm-ui/backend/db_services/redis/resources/redis_cluster/query.py @@ -12,7 +12,7 @@ from django.db.models import QuerySet from django.forms import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.db_meta.api.cluster.rediscluster.handler import RedisClusterHandler diff --git a/dbm-ui/backend/db_services/redis/resources/redis_cluster/views.py b/dbm-ui/backend/db_services/redis/resources/redis_cluster/views.py index 88e2cf5a27..a500fa95c2 100644 --- a/dbm-ui/backend/db_services/redis/resources/redis_cluster/views.py +++ b/dbm-ui/backend/db_services/redis/resources/redis_cluster/views.py @@ -11,7 +11,7 @@ import base64 from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/redis/resources/views.py b/dbm-ui/backend/db_services/redis/resources/views.py index 790f72e586..9ec54dfaef 100644 --- a/dbm-ui/backend/db_services/redis/resources/views.py +++ b/dbm-ui/backend/db_services/redis/resources/views.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/redis/rollback/handlers.py b/dbm-ui/backend/db_services/redis/rollback/handlers.py index 23a5ddbabb..07b33d8694 100644 --- a/dbm-ui/backend/db_services/redis/rollback/handlers.py +++ b/dbm-ui/backend/db_services/redis/rollback/handlers.py @@ -13,7 +13,7 @@ from datetime import datetime, timedelta from typing import Any, Dict, List, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components.bklog.client import BKLogApi diff --git a/dbm-ui/backend/db_services/redis/rollback/models/tb_tendis_data_construction_task.py b/dbm-ui/backend/db_services/redis/rollback/models/tb_tendis_data_construction_task.py index d07b5e58d1..deebb6bd4f 100644 --- a/dbm-ui/backend/db_services/redis/rollback/models/tb_tendis_data_construction_task.py +++ b/dbm-ui/backend/db_services/redis/rollback/models/tb_tendis_data_construction_task.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterType, DataStructureStatus, DestroyedStatus diff --git a/dbm-ui/backend/db_services/redis/rollback/views.py b/dbm-ui/backend/db_services/redis/rollback/views.py index 1aefa84756..6cc92e7d1d 100644 --- a/dbm-ui/backend/db_services/redis/rollback/views.py +++ b/dbm-ui/backend/db_services/redis/rollback/views.py @@ -10,7 +10,7 @@ """ from django.utils.decorators import method_decorator -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django_filters import rest_framework as filters from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/redis/slots_migrate/models/slots_migration_record.py b/dbm-ui/backend/db_services/redis/slots_migrate/models/slots_migration_record.py index f0d3d720cf..5afe17d201 100644 --- a/dbm-ui/backend/db_services/redis/slots_migrate/models/slots_migration_record.py +++ b/dbm-ui/backend/db_services/redis/slots_migrate/models/slots_migration_record.py @@ -1,5 +1,5 @@ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel from backend.db_meta.enums import ClusterType, MigrateStatus diff --git a/dbm-ui/backend/db_services/redis/toolbox/views.py b/dbm-ui/backend/db_services/redis/toolbox/views.py index 23e73606f8..9768fcba20 100644 --- a/dbm-ui/backend/db_services/redis/toolbox/views.py +++ b/dbm-ui/backend/db_services/redis/toolbox/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/taskflow/exceptions.py b/dbm-ui/backend/db_services/taskflow/exceptions.py index 327d0bd68e..01f7f6309a 100644 --- a/dbm-ui/backend/db_services/taskflow/exceptions.py +++ b/dbm-ui/backend/db_services/taskflow/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/db_services/taskflow/serializers.py b/dbm-ui/backend/db_services/taskflow/serializers.py index 8044b1f99d..7c31f0d38e 100644 --- a/dbm-ui/backend/db_services/taskflow/serializers.py +++ b/dbm-ui/backend/db_services/taskflow/serializers.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.consts import PipelineStatus diff --git a/dbm-ui/backend/db_services/taskflow/task.py b/dbm-ui/backend/db_services/taskflow/task.py index d1268425c7..c314b04f39 100644 --- a/dbm-ui/backend/db_services/taskflow/task.py +++ b/dbm-ui/backend/db_services/taskflow/task.py @@ -13,7 +13,7 @@ from bamboo_engine.api import EngineAPIResult from celery import shared_task -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.eri.signals import post_set_state from backend.db_meta.exceptions import ClusterExclusiveOperateException diff --git a/dbm-ui/backend/db_services/taskflow/views/flow.py b/dbm-ui/backend/db_services/taskflow/views/flow.py index 0e261dd949..04cf826814 100644 --- a/dbm-ui/backend/db_services/taskflow/views/flow.py +++ b/dbm-ui/backend/db_services/taskflow/views/flow.py @@ -11,7 +11,7 @@ import logging from django.http import HttpResponse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/taskflow/views/redis.py b/dbm-ui/backend/db_services/taskflow/views/redis.py index c6027394b3..56360e07a1 100644 --- a/dbm-ui/backend/db_services/taskflow/views/redis.py +++ b/dbm-ui/backend/db_services/taskflow/views/redis.py @@ -11,7 +11,7 @@ import os import humanize -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.renderers import BaseRenderer from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/user/views.py b/dbm-ui/backend/db_services/user/views.py index f5ae8dc6e1..651abfa948 100644 --- a/dbm-ui/backend/db_services/user/views.py +++ b/dbm-ui/backend/db_services/user/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/db_services/version/views.py b/dbm-ui/backend/db_services/version/views.py index dd0657482b..e03358b1a7 100644 --- a/dbm-ui/backend/db_services/version/views.py +++ b/dbm-ui/backend/db_services/version/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/dbm_init/apps.py b/dbm-ui/backend/dbm_init/apps.py index 05fc6f3ded..97939b0363 100644 --- a/dbm-ui/backend/dbm_init/apps.py +++ b/dbm-ui/backend/dbm_init/apps.py @@ -11,7 +11,7 @@ import logging from django.apps import AppConfig -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ logger = logging.getLogger("root") diff --git a/dbm-ui/backend/dbm_init/management/commands/cloud_component.py b/dbm-ui/backend/dbm_init/management/commands/cloud_component.py index 8fd66b62da..4baed8ffc2 100644 --- a/dbm-ui/backend/dbm_init/management/commands/cloud_component.py +++ b/dbm-ui/backend/dbm_init/management/commands/cloud_component.py @@ -11,7 +11,7 @@ import logging from django.core.management.base import BaseCommand -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.ticket.handler import TicketHandler diff --git a/dbm-ui/backend/env/__init__.py b/dbm-ui/backend/env/__init__.py index e98577900d..7f69d70691 100644 --- a/dbm-ui/backend/env/__init__.py +++ b/dbm-ui/backend/env/__init__.py @@ -14,11 +14,11 @@ from .apm import * # pylint: disable=wildcard-import from .bklog import * # pylint: disable=wildcard-import from .bkrepo import * # pylint: disable=wildcard-import -from .dev import * # pylint: disable=wildcard-import +from .db_extention import * # pylint: disable=wildcard-import from .nameservice import * # pylint: disable=wildcard-import APP_CODE = get_type_env(key="APP_ID", default="bk-dbm", _type=str) -SECRET_KEY = get_type_env(key="APP_TOKEN", default="yb2gur=g)hxbmpk3#b%ez5_#6o!tf9vkqsnwo4dxyr0n&w3=9k", _type=str) +SECRET_KEY = get_type_env(key="APP_TOKEN", default="to-be-completed", _type=str) DEFAULT_USERNAME = get_type_env(key="DEFAULT_USERNAME", default="admin", _type=str) RUN_VER = get_type_env(key="RUN_VER", default="open", _type=str) diff --git a/dbm-ui/backend/env/apigw_domains.py b/dbm-ui/backend/env/apigw_domains.py index 361d3bcb0e..752f63347c 100644 --- a/dbm-ui/backend/env/apigw_domains.py +++ b/dbm-ui/backend/env/apigw_domains.py @@ -40,7 +40,6 @@ SLOW_QUERY_PARSER_DOMAIN = get_type_env( key="SLOW_QUERY_PARSER_DOMAIN", _type=str, default="http://bk-dbm-slow-query-parser-service" ) -DBHA_APIGW_DOMAIN_LIST = get_type_env(key="DBHA_APIGW_DOMAIN_LIST", _type=list, default=[]) # todo 备份服务器已经设置好mysql密码。后续需要获取mysql随机账号 BACKUP_DOWNLOAD_USER = get_type_env(key="BACKUP_DOWNLOAD_USER", _type=str, default="mysql") BACKUP_DOWNLOAD_USER_PWD = get_type_env(key="BACKUP_DOWNLOAD_USER", _type=str, default="") diff --git a/dbm-ui/backend/env/dev.py b/dbm-ui/backend/env/db_extention.py similarity index 70% rename from dbm-ui/backend/env/dev.py rename to dbm-ui/backend/env/db_extention.py index 3d2dae04fa..7aa935e5f2 100644 --- a/dbm-ui/backend/env/dev.py +++ b/dbm-ui/backend/env/db_extention.py @@ -10,14 +10,18 @@ """ from backend.utils.env import get_type_env -# 云区域组件旁路配置 +# 云区域组件旁路配置,当本地开发或者直连云区域组件使用容器化部署时开启 DRS_SKIP_SSL = get_type_env(key="DRS_SKIP_SSL", _type=bool, default=False) DOMAIN_SKIP_PROXY = get_type_env(key="DOMAIN_SKIP_PROXY", _type=bool, default=False) -DRS_USERNAME = get_type_env(key="DRS_USERNAME", _type=str, default="") -DRS_PASSWORD = get_type_env(key="DRS_PASSWORD", _type=str, default="") -DBHA_USERNAME = get_type_env(key="DBHA_USERNAME", _type=str, default="") -DBHA_PASSWORD = get_type_env(key="DBHA_PASSWORD", _type=str, default="") -TEST_ACCESS_HOSTS = get_type_env(key="TEST_ACCESS_HOSTS", _type=list, default=[]) + +DRS_USERNAME = get_type_env(key="DRS_USERNAME", _type=str, default=get_type_env(key="APP_ID")) +DRS_PASSWORD = get_type_env(key="DRS_PASSWORD", _type=str, default=get_type_env(key="APP_TOKEN")) +DBHA_USERNAME = get_type_env(key="DBHA_USERNAME", _type=str, default=get_type_env(key="APP_ID")) +DBHA_PASSWORD = get_type_env(key="DBHA_PASSWORD", _type=str, default=get_type_env(key="APP_TOKEN")) + +# 直连区域的服务访问地址(一般为结合 k8s nodeSelector 固定 Node 所在的 IP,本地开发时可指向测试的服务地址) +DEFAULT_CLOUD_DRS_ACCESS_HOSTS = get_type_env(key="DEFAULT_CLOUD_DRS_ACCESS_HOSTS", _type=list, default=["%"]) +DEFAULT_CLOUD_DBHA_ACCESS_HOSTS = get_type_env(key="DEFAULT_CLOUD_DBHA_ACCESS_HOSTS", _type=list, default=["%"]) # 资源池伪造开关 FAKE_RESOURCE_APPLY_ENABLE = get_type_env(key="FAKE_RESOURCE_APPLY_ENABLE", _type=bool, default=False) diff --git a/dbm-ui/backend/exceptions.py b/dbm-ui/backend/exceptions.py index afd670eb30..35c588aed1 100644 --- a/dbm-ui/backend/exceptions.py +++ b/dbm-ui/backend/exceptions.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from iam import IAM from backend import env diff --git a/dbm-ui/backend/flow/consts.py b/dbm-ui/backend/flow/consts.py index 97c528ebba..4d78ae5e5c 100644 --- a/dbm-ui/backend/flow/consts.py +++ b/dbm-ui/backend/flow/consts.py @@ -181,7 +181,6 @@ class NameSpaceEnum(str, StructuredEnum): class ConfigTypeEnum(str, StructuredEnum): InitUser = EnumField("init_user", _("初始化帐户")) - MySQLAndUser = EnumField("mysql#user", _("实例和帐户")) OSConf = EnumField("osconf", _("系统配置")) DBConf = EnumField("dbconf", _("实例配置")) Config = EnumField("config", _("默认配置")) diff --git a/dbm-ui/backend/flow/engine/bamboo/engine.py b/dbm-ui/backend/flow/engine/bamboo/engine.py index 0dc3465887..89d1429a97 100644 --- a/dbm-ui/backend/flow/engine/bamboo/engine.py +++ b/dbm-ui/backend/flow/engine/bamboo/engine.py @@ -15,7 +15,7 @@ from bamboo_engine import api, builder, states from bamboo_engine.api import EngineAPIResult from bamboo_engine.builder import Data -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.eri.runtime import BambooDjangoRuntime from backend.flow.engine.bamboo.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py index f832817987..284c6d2dab 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/base_service_flow.py @@ -14,7 +14,7 @@ from bamboo_engine.builder import SubProcess from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.core.encrypt.constants import AsymmetricCipherConfigType from backend.core.encrypt.handlers import AsymmetricHandler diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py index bb1e58c95b..ffe1bbfe7a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dbha_service_flow.py @@ -11,7 +11,7 @@ from typing import Dict, List, Tuple, Union from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.flow.consts import CloudDBHATypeEnum, CloudServiceName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dns_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dns_service_flow.py index e3847cfddc..87f493164a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dns_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/dns_service_flow.py @@ -13,7 +13,7 @@ from typing import Dict, List, Union from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.cloud.base_service_flow import CloudBaseServiceFlow from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/drs_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/drs_service_flow.py index 53c090dbc1..e1379fa119 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/drs_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/drs_service_flow.py @@ -12,7 +12,7 @@ from typing import List, Union from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_proxy.constants import ExtensionType from backend.db_proxy.models import DBExtension diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/nginx_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/nginx_service_flow.py index 895012a6b2..18c154dec0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/nginx_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/nginx_service_flow.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.cloud.base_service_flow import CloudBaseServiceFlow from backend.flow.engine.bamboo.scene.cloud.dbha_service_flow import CloudDBHAServiceFlow diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py index bee041b1d0..3d57564603 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/cloud/redis_dts_server_service_flow.py @@ -12,7 +12,7 @@ from typing import List, Union from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.cloud.base_service_flow import CloudBaseServiceFlow from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/common/atom_jobs/set_dns_sub_job.py b/dbm-ui/backend/flow/engine/bamboo/scene/common/atom_jobs/set_dns_sub_job.py index a5bf6525a0..8d1471d58b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/common/atom_jobs/set_dns_sub_job.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/common/atom_jobs/set_dns_sub_job.py @@ -13,7 +13,7 @@ from typing import Dict, Optional from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import WriteContextOpType from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/common/builder.py b/dbm-ui/backend/flow/engine/bamboo/scene/common/builder.py index 857c311272..53c4067dad 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/common/builder.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/common/builder.py @@ -26,7 +26,7 @@ Var, ) from django.utils import translation -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.eri.runtime import BambooDjangoRuntime from backend.flow.models import FlowNode, FlowTree, StateType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/common/machine_os_init.py b/dbm-ui/backend/flow/engine/bamboo/scene/common/machine_os_init.py index 44dc1f1b7e..1e6fb6a39b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/common/machine_os_init.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/common/machine_os_init.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components.dbresource.client import DBResourceApi diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_apply_flow.py index f7267f345a..392e845491 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import ( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_destroy_flow.py index 027e9a7417..2a94177e8e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_disable_flow.py index 5bf310576c..4086fa2c39 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_enable_flow.py index e2513b79ab..05220bdd3e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py index 5e62201dbd..376dbac99f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_fake_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import ManagerDefaultPort, ManagerOpType, ManagerServiceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_reboot_flow.py index 6777441fe4..58f33ab4de 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_reboot_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_replace_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_replace_flow.py index c004bab7f6..260f1c1cad 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_replace_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_replace_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import ( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_scale_up_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_scale_up_flow.py index c4d8e0bc52..fe822c1cf8 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_scale_up_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_scale_up_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import ES_DEFAULT_INSTANCE_NUM, DnsOpType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_shrink_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_shrink_flow.py index 530b0ecf56..598e7ce877 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/es/es_shrink_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/es/es_shrink_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerDefaultPort, ManagerOpType, ManagerServiceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/exceptions.py index ab9d86a56e..edaa845f89 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_apply_flow.py index 2336811051..8074afe575 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_destroy_flow.py index d87c427596..a6b187170c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_destroy_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_disable_flow.py index 3c16e0071d..92e370e93a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_disable_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_enable_flow.py index 0a129d0831..2ddcd664b5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_enable_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_fake_apply_flow.py index da7fb97d6b..238e5bb4d1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_fake_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_fake_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_reboot_flow.py index 1ad983e513..e50d1d8411 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_reboot_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_replace_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_replace_flow.py index 4989cbd84c..a60998598c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_replace_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_replace_flow.py @@ -12,7 +12,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_scale_up_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_scale_up_flow.py index 137e158ace..bd18487a0e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_scale_up_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_scale_up_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_shrink_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_shrink_flow.py index ecac3a80f6..e028e0a27c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_shrink_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_shrink_flow.py @@ -12,7 +12,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_sub_flow.py index f09f0b7dc5..027511ef00 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/hdfs/hdfs_sub_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_apply_flow.py index a14f300de0..1f5680dad7 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_destroy_flow.py index 620ed0ecdc..415bd5fe3e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_disable_flow.py index d395d1c020..63f5938de0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_enable_flow.py index 641027c2d0..63f0b29b29 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_fake_apply_flow.py index 069bd97b03..421b9cdaad 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_fake_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_fake_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_reboot_flow.py index 7dbd8d543e..4653ccc8df 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_reboot_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import InfluxdbActuatorActionEnum diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_replace_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_replace_flow.py index fd83390b3d..ca643eda51 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_replace_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/influxdb/influxdb_replace_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_apply_flow.py index 82c1f1e0b7..e5ec2d0ea9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_destroy_flow.py index bfcd57f025..9e1a8807b6 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_disable_flow.py index 5f0835a60b..4cd778c888 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType, InstanceRole from backend.db_meta.models import Cluster, StorageInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_enable_flow.py index ecbc6062c0..4e57866751 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType, InstanceRole from backend.db_meta.models import Cluster, StorageInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py index e4c5682233..54cfaded3f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_fake_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_reboot_flow.py index 45f4fc10ae..892510c8fa 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_reboot_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_replace_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_replace_flow.py index af139ee6b3..99fe07993c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_replace_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_replace_flow.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import ConfType, FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_scale_up_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_scale_up_flow.py index 32f9da2a80..daf1308ea5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_scale_up_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_scale_up_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import ConfType, FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_shrink_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_shrink_flow.py index acdce07b04..d9af293ad0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_shrink_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/kafka/kafka_shrink_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_backup.py index 8827cdb653..355dcf65d3 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_backup.py @@ -11,7 +11,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_deinstall.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_deinstall.py index 6a67b0150e..295ff5b75c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_deinstall.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_deinstall.py @@ -11,7 +11,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder from backend.flow.engine.bamboo.scene.mongodb.sub_task import deinstall diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_fake_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_fake_install.py index a65d431cc8..391fe4dc91 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_fake_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_fake_install.py @@ -12,7 +12,7 @@ from dataclasses import dataclass from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_install.py index d025a4527a..85843c769e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_install.py @@ -11,7 +11,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBClusterRole from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_remove_ns.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_remove_ns.py index 4b2df951c9..5655fc5580 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_remove_ns.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_remove_ns.py @@ -11,7 +11,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_restore.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_restore.py index 3c1dc4224a..464cc8ccae 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_restore.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_restore.py @@ -12,7 +12,7 @@ import logging.config from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/backup.py index 5e82634862..c60729f4f9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/backup.py @@ -11,7 +11,7 @@ import logging.config from typing import Dict, List, Optional, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBActuatorActionEnum from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_replace.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_replace.py index 2ac4347acf..571c16bed2 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_replace.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_replace.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.consts import MongoDBClusterRole, MongoDBInstanceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/deinstall.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/deinstall.py index 64aab0ba5b..2ad5dc2444 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/deinstall.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/deinstall.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.consts import MongoDBInstanceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/download_subtask.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/download_subtask.py index 7328885156..885d2e1fa4 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/download_subtask.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/download_subtask.py @@ -10,7 +10,7 @@ """ from typing import Dict, List, Optional, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import SubBuilder from backend.flow.engine.bamboo.scene.mongodb.sub_task.base_subtask import BaseSubTask diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/exec_script.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/exec_script.py index c20f472d25..eb49aea34c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/exec_script.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/exec_script.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBManagerUser from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/instance_restart.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/instance_restart.py index e3782ad6d2..313ae2b469 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/instance_restart.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/instance_restart.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import SubBuilder from backend.flow.plugins.components.collections.mongodb.exec_actuator_job import ExecuteDBActuatorJobComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongod_replace.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongod_replace.py index b9bda3398f..fdfa0167d0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongod_replace.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongod_replace.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.consts import MongoDBClusterRole, MongoDBInstanceType, MongoDBManagerUser diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_install.py index dc408a18d9..bfe4eb2408 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_install.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBManagerUser from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_replace.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_replace.py index 410c4556f6..dc638ff4c8 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_replace.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/mongos_replace.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.consts import MongoDBInstanceType, MongoDBManagerUser diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/remove_ns.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/remove_ns.py index fa9a66124e..b17883cfe5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/remove_ns.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/remove_ns.py @@ -10,7 +10,7 @@ """ from typing import Dict, List, Optional, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBActuatorActionEnum from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_install.py index 6a0ffae2ef..a90e380cdc 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_install.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBManagerUser, MongoDBTask from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_replace.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_replace.py index 110b3fd23f..7f795d624e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_replace.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/replicaset_replace.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.consts import MongoDBClusterRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/restore_sub.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/restore_sub.py index 9147aa53fe..963d5303b1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/restore_sub.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/restore_sub.py @@ -10,7 +10,7 @@ """ from typing import Dict, List, Optional, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBActuatorActionEnum from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/user.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/user.py index ec17d57858..2fefdf7555 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/user.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/user.py @@ -12,7 +12,7 @@ from copy import deepcopy from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MongoDBManagerUser from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/exceptions.py index d5dde8cb11..c3b7feaba9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/exceptions.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_local_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_local_backup.py index d31540e0d8..cc35f34153 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_local_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_local_backup.py @@ -13,7 +13,7 @@ import os.path from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py index fbbec58a2d..18085e10c3 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/master_and_slave_switch.py @@ -12,7 +12,7 @@ from dataclasses import asdict from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterEntryType, InstanceInnerRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/mysql_resotre_data_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/mysql_resotre_data_sub_flow.py index 266656c853..81f3233457 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/mysql_resotre_data_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/mysql_resotre_data_sub_flow.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import MYSQL_DATA_RESTORE_TIME, MYSQL_USUAL_JOB_TIME from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py index 8740aabac1..bb1f59d7b4 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/recover_slave_instance.py @@ -14,7 +14,7 @@ from datetime import datetime from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import MYSQL_DATA_RESTORE_TIME, MYSQL_USUAL_JOB_TIME from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py index a6c21abe29..1d25667f10 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py @@ -9,7 +9,7 @@ """ from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py index 7460a7afed..671cfdc6a9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/uninstall_instance.py @@ -10,7 +10,7 @@ """ from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import SubBuilder from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py index bd2fd1f797..08bbdf3c41 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/import_sqlfile_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Any, Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_authorize_rules.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_authorize_rules.py index df2504e1bd..d2a284c401 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_authorize_rules.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_authorize_rules.py @@ -11,7 +11,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder from backend.flow.plugins.components.collections.mysql.authorize_rules import AuthorizeRulesComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_checksum.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_checksum.py index 131bb98819..da8afd82c9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_checksum.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_checksum.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_clone_rules.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_clone_rules.py index a364ab6364..7550347065 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_clone_rules.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_clone_rules.py @@ -11,7 +11,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder from backend.flow.plugins.components.collections.mysql.clone_rules import CloneRulesComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_edit_config_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_edit_config_flow.py index c80912cd57..9cdbf6eb70 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_edit_config_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_edit_config_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceInnerRole, InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_fake_sql_semantic_check.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_fake_sql_semantic_check.py index 49ed4df36a..015859b96b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_fake_sql_semantic_check.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_fake_sql_semantic_check.py @@ -11,7 +11,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder from backend.flow.plugins.components.collections.mysql.fake_semantic_check import FakeSemanticCheckComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_flashback_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_flashback_flow.py index 314bdd3d12..a3bbf4c404 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_flashback_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_flashback_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceInnerRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_apply_flow.py index a440af30be..5582531a78 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_db_table_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_db_table_backup.py index 4a077debb0..4a6a2b7b4a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_db_table_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_db_table_backup.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceInnerRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_destroy_flow.py index 6cfe432450..c8033a4c83 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_disable_flow.py index 5a6d5f95bd..01a1b2ee61 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_enable_flow.py index 9fac9ce379..d41f542331 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryType, InstanceInnerRole from backend.db_meta.models import Cluster, ProxyInstance, StorageInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_full_backup_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_full_backup_flow.py index d997f4f7c1..669ba7553b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_full_backup_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_full_backup_flow.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceInnerRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py index fd02594d57..0580964b99 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_metadata_import.py @@ -13,7 +13,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.plugins.components.collections.common.pause import PauseComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py index 7cd57eb229..dd2e10a0ca 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_ha_standardize_flow.py @@ -15,7 +15,7 @@ from dataclasses import asdict from typing import Dict, List, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_fail_over.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_fail_over.py index 3de8b9cc80..6d24518b7d 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_fail_over.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_fail_over.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_slave_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_slave_switch.py index c170c11006..bd5c633c8a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_slave_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_master_slave_switch.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_flow.py index 158dfea508..c4f254753c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py index 7a9b801e2a..5fb883290f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceInnerRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py index 227ad0a26b..abae9c7876 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_open_area_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.core.consts import BK_PKG_INSTALL_PATH diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_partition.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_partition.py index aa9c6e7106..252e4f7094 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_partition.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_partition.py @@ -5,7 +5,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.core.consts import BK_PKG_INSTALL_PATH diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_add.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_add.py index c6d7df0041..d55cb7f03c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_add.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_add.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterEntryType, ClusterType, InstanceInnerRole, InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_switch.py index 56f3fb29c2..10578e1598 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_cluster_switch.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterEntryType, ClusterType, InstanceInnerRole, InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_upgrade.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_upgrade.py index 245671ea19..939c745db7 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_upgrade.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_proxy_upgrade.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.exceptions import DBMetaException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_random_password.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_random_password.py index 0b5facdab7..b5789b75f1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_random_password.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_random_password.py @@ -12,7 +12,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBPrivManagerApi from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rename_database_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rename_database_flow.py index 5eea41e461..91271e5fc4 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rename_database_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rename_database_flow.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.exceptions import ClusterNotExistException, MasterInstanceNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_flow.py index f64fa130c7..61339c1800 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py index 1406e8ead5..dcf152ac2a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py index d97154fba2..a74620fb91 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py index 6bc39bbf85..7638299412 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_rollback_data_sub_flow.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import MYSQL_DATA_RESTORE_TIME, DBType from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_apply_flow.py index c2238ccf95..b642d80ee8 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_destroy_flow.py index 6731d2ae47..421627b588 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_disable_flow.py index a996e00dae..583f0b14e1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models import Cluster from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_enable_flow.py index 964b21369f..f98e7586a9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_single_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryType from backend.db_meta.models import Cluster, StorageInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_truncate_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_truncate_flow.py index 0e9f0b9c81..b3c9149a05 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_truncate_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_truncate_flow.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.exceptions import ClusterNotExistException, DBMetaException, MasterInstanceNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/pt_table_sync.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/pt_table_sync.py index 68c695f3a5..69a5af6762 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/pt_table_sync.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/pt_table_sync.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py b/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py index 07decaa484..454f7401e2 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/name_service/name_service.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder from backend.flow.plugins.components.collections.name_service.name_service import ExecNameServiceOperationComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/exceptions.py index a76342ab26..907b77b956 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py index 986afdb2a6..458a6ab647 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType, MediumFileTypeEnum, PulsarRoleEnum diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_base_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_base_flow.py index 3de5482feb..1bd1338d70 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_base_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_base_flow.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DOMAIN_RESOLUTION_SUPPORT from backend.configuration.models import SystemSettings diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_destroy_flow.py index 639f8430fb..a6d20266ae 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_disable_flow.py index c1524151d2..1340c6fcc2 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_enable_flow.py index 6fff0c9a51..daf8660bfb 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py index aeeb264c35..c8c66f6485 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_fake_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_reboot_flow.py index 897cf58259..8acec15d40 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_reboot_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_replace_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_replace_flow.py index aca3eb2d12..443e1a2e02 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_replace_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_replace_flow.py @@ -3,7 +3,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, ManagerOpType, ManagerServiceType, MediumFileTypeEnum, PulsarRoleEnum diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_scale_up_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_scale_up_flow.py index 4998f1c9ab..3d08221081 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_scale_up_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_scale_up_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, MediumFileTypeEnum, PulsarRoleEnum diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_shrink_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_shrink_flow.py index cef8a6f1c8..4e118409d4 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_shrink_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_shrink_flow.py @@ -2,7 +2,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DnsOpType, PulsarRoleEnum diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_sub_flow.py index da476f1e75..31f9605f70 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/pulsar/pulsar_sub_flow.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import InstanceRole from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/access_manager.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/access_manager.py index bad7776221..fba6bfe394 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/access_manager.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/access_manager.py @@ -13,7 +13,7 @@ from typing import Dict, Optional from bamboo_engine.builder import SubProcess -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryRole from backend.db_meta.models import Cluster, ClusterEntry diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/predixy_config_servers_rewrite.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/predixy_config_servers_rewrite.py index 16818adc03..0d02487d36 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/predixy_config_servers_rewrite.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/predixy_config_servers_rewrite.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py index f5bb8c367e..51137f981b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_install.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums.cluster_type import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_uninstall.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_uninstall.py index 7255596900..8b8b0ef38d 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_uninstall.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/proxy_uninstall.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums.cluster_type import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py index 112a252b2d..8a76dbbd16 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_master_rep.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py index a5846c3ad6..76c8e76872 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_cluster_slave_rep.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dbmon.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dbmon.py index f4cb58c081..80e884e365 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dbmon.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dbmon.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dts.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dts.py index 632f500cff..d20e3e8133 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dts.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_dts.py @@ -11,7 +11,7 @@ import copy from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_services.redis.redis_dts.enums import DtsCopyType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py index 491d9178c5..91384d9b99 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_install.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py index 91f2334b95..69e3c43dd7 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_makesync.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_repair.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_repair.py index a0d02feed3..b20d67de92 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_repair.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_repair.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py index f462a387d0..aa8bb501b7 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_shutdown.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_switch.py index 2a8fcd7e30..6aa4735784 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/redis_switch.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/reupload_old_backup_records.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/reupload_old_backup_records.py index 8b3c0519ed..6311f33628 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/reupload_old_backup_records.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/atom_jobs/reupload_old_backup_records.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import DEFAULT_BK_CLOUD_ID diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py index 5ab9236971..2ec3564cd5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/common/exceptions.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py index ef15530387..5e4102aa84 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_add_dts_server.py @@ -11,7 +11,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_backend_scale.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_backend_scale.py index 1ade3716b5..197f7f9434 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_backend_scale.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_backend_scale.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py index bb568e6dea..22f38434c6 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_add_slave.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_backup.py index 37b4979fe8..78225e8cad 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_backup.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_check_repair.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_check_repair.py index 32b923259e..502ec9c767 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_check_repair.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_check_repair.py @@ -14,7 +14,7 @@ from datetime import datetime, timezone from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py index 4ef75fb1f4..fb7889e51e 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_data_copy.py @@ -16,7 +16,7 @@ from dataclasses import asdict from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_instance_shutdown.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_instance_shutdown.py index c535e7bebd..e91c5171a5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_instance_shutdown.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_instance_shutdown.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_migrate_load.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_migrate_load.py index a532ee125e..f4bdb93e48 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_migrate_load.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_migrate_load.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import ConfType, FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_open_close.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_open_close.py index ed1d1eb3c2..8cf2dbf7b5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_open_close.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_open_close.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import MachineType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py index a492c9f566..a2b88b2668 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_auotfix.py @@ -15,7 +15,7 @@ from dataclasses import asdict from typing import Any, Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_cmr.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_cmr.py index 653c6a325e..5493ad3879 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_cmr.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_cmr.py @@ -15,7 +15,7 @@ from dataclasses import asdict from typing import Any, Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py index 0456525fb4..dc2ea65390 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_scene_mss.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_shutdown.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_shutdown.py index 1b72752f6a..7e2f5020aa 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_shutdown.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_shutdown.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py index 5566963030..0b6f8e3099 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_cluster_version_update_online.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.api.cluster import nosqlcomm diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py index 8a9db1c46f..d0b9b552e6 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure.py @@ -15,7 +15,7 @@ from dataclasses import asdict from typing import Any, Dict, List, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py index 372dd3e933..3722e95ee3 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_sub.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums.cluster_type import ClusterType from backend.flow.engine.bamboo.scene.common.builder import SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_task_delete.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_task_delete.py index aba45f48bd..dda5eabb80 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_task_delete.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_data_structure_task_delete.py @@ -15,7 +15,7 @@ from datetime import datetime from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import DestroyedStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_flush_data.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_flush_data.py index e024916c2f..eb35e18ec0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_flush_data.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_flush_data.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_instance_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_instance_apply_flow.py index 9317601551..b3f1fd882d 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_instance_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_instance_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import AffinityEnum, DBType from backend.db_meta.api import common diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_delete.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_delete.py index a0f8781ea8..43b051c3cd 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_delete.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_delete.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_extract.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_extract.py index a061012fe0..8a6b93cab8 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_extract.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_keys_extract.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_predixy_cluster_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_predixy_cluster_apply_flow.py index dc70742b8b..d2841f7b14 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_predixy_cluster_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_predixy_cluster_apply_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import AffinityEnum from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_proxy_scale.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_proxy_scale.py index e1830b72a6..d1204d5e8a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_proxy_scale.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_proxy_scale.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Any, Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_remove_dts_server.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_remove_dts_server.py index 5614204cb2..9c5c195df9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_remove_dts_server.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_remove_dts_server.py @@ -11,7 +11,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate.py index 8f02609a4c..f1d99416ec 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Any, Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate_sub.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate_sub.py index 50e554343a..f7e016a456 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate_sub.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_slots_migrate_sub.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_twemproxy_cluster_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_twemproxy_cluster_apply_flow.py index 759253ae7f..c86095fd26 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_twemproxy_cluster_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/redis_twemproxy_cluster_apply_flow.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import AffinityEnum from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/singele_redis_shutdown.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/singele_redis_shutdown.py index 6d57e481e0..04e22c33f6 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/singele_redis_shutdown.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/singele_redis_shutdown.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import StorageInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py index f427b0b6f3..f28b0a401b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_apply_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import ConfType, FormatType, LevelName, ReqType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py index 2cd0a3a7ff..76f099cbb0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_destroy_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py index 036bdef24b..41cb7ebb6f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_disable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py index 1e753c18ae..3921bd5da5 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_enable_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_migrate_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_migrate_flow.py index 323d38f2aa..3e85e187e9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_migrate_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_migrate_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import ConfType, FormatType, LevelName, ReqType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_reboot_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_reboot_flow.py index 0a57db8c05..c7142a0284 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_reboot_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_reboot_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py index b696b083f4..e5b2e3edcf 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_in_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py index c35cff1f50..7067762838 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/riak/riak_cluster_scale_out_flow.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.flow.consts import DBA_ROOT_USER, DEPENDENCIES_PLUGINS diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/append_deploy_ctl_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/append_deploy_ctl_flow.py index 27bf412b23..0b26d6d873 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/append_deploy_ctl_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/append_deploy_ctl_flow.py @@ -13,7 +13,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.db_remote_service.client import DRSApi from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py index 6ec7641aeb..7a2fdacc74 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py @@ -10,7 +10,7 @@ from dataclasses import asdict from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/exceptions.py index bef3518a30..b692268ff9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/exceptions.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/import_sqlfile_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/import_sqlfile_flow.py index f917bebd5c..e182d64c8c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/import_sqlfile_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/import_sqlfile_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py index 05f91c62a3..fb8627cd79 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_local_slave_recover.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_master_slave_swtich.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_master_slave_swtich.py index c1b12b40a9..e916fd9859 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_master_slave_swtich.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_master_slave_swtich.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceStatus diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py index ea83b551c1..0153f9fad9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/remote_slave_recover.py @@ -14,7 +14,7 @@ from typing import Dict, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_mnt.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_mnt.py index 717e02fb6a..f34f651d1f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_mnt.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_mnt.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import TenDBClusterSpiderRole from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_nodes.py index 263d8d185b..7e6e60ba85 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_add_nodes.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryRole, TenDBClusterSpiderRole from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_checksum.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_checksum.py index f5b5278cf6..40199f3761 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_checksum.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_checksum.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_db_table_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_db_table_backup.py index f4a4350da6..f3451b813a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_db_table_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_db_table_backup.py @@ -16,7 +16,7 @@ from typing import Dict, List, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py index 3f7197f972..d0f1054b35 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_deploy.py @@ -14,7 +14,7 @@ from typing import Dict, List, Optional from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_destroy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_destroy.py index af0e1b93e6..076588b152 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_destroy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_destroy.py @@ -11,7 +11,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import TenDBClusterSpiderRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_disable_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_disable_deploy.py index 376c877f87..1855974f18 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_disable_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_disable_deploy.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterEntryRole, ClusterEntryType, ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_enable_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_enable_deploy.py index e9bb7d5cf2..dcca41b751 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_enable_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_enable_deploy.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryRole from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_flashback.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_flashback.py index d0ba223480..59c6b97a9b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_flashback.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_flashback.py @@ -16,7 +16,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceInnerRole, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py index 0aae7716fd..1c1e6cddd9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_full_backup.py @@ -16,7 +16,7 @@ from typing import Dict, List, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_metadata_import_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_metadata_import_flow.py index a68a4bc353..a641b373da 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_metadata_import_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_metadata_import_flow.py @@ -13,7 +13,7 @@ import logging from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.plugins.components.collections.common.pause import PauseComponent diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py index 515c68fb16..bf007a7587 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_rollback_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_services.mysql.fixpoint_rollback.handlers import FixPointRollbackHandler diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_standardize_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_standardize_flow.py index b7b1a9110e..9faa7c5caf 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_standardize_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_standardize_flow.py @@ -14,7 +14,7 @@ from dataclasses import asdict from typing import Dict, List, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_truncate_database.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_truncate_database.py index e2d41b74a2..6bc06ce997 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_truncate_database.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_cluster_truncate_database.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceInnerRole, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_partition.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_partition.py index 7964b7845e..1d6205a12d 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_partition.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_partition.py @@ -5,7 +5,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.core.consts import BK_PKG_INSTALL_PATH diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py index d2a0f8f41b..273745ea1a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_recover.py @@ -10,7 +10,7 @@ """ from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import MYSQL_DATA_RESTORE_TIME from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_mnt.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_mnt.py index fba4e4e70d..ff71ccd399 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_mnt.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_mnt.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import TenDBClusterSpiderRole from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py index fc352c1e20..89dc69989f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import TenDBClusterSpiderRole from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py index 5e31030d64..f22e9ad15f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remote_node_migrate.py @@ -11,7 +11,7 @@ import copy from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import MYSQL_DATA_RESTORE_TIME, MYSQL_USUAL_JOB_TIME, DBType from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_migrate_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_migrate_flow.py index 74d54c1d52..7106b3d9d0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_migrate_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_migrate_flow.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.spider.spider_remote_node_migrate import ( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py index 08def5aeb7..4193a971f9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_remotedb_rebalance_flow.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.constants import IP_PORT_DIVIDER from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_rename_database_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_rename_database_flow.py index d9f0953da8..03267adc1c 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_rename_database_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_rename_database_flow.py @@ -15,7 +15,7 @@ from typing import Dict, Optional from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceInnerRole, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_deploy.py index 48894c1aa6..4ac2e5c486 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_deploy.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import TenDBClusterSpiderRole from backend.db_meta.exceptions import ClusterNotExistException diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_destroy.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_destroy.py index 573db68f4d..8d5df66757 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_destroy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_slave_cluster_destroy.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterEntryRole, ClusterEntryType, TenDBClusterSpiderRole from backend.db_meta.models import Cluster, ProxyInstance diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/build_database_sync.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/build_database_sync.py index 67785d35e4..fb4bf3da16 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/build_database_sync.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/build_database_sync.py @@ -11,7 +11,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import InstanceRole, InstanceStatus from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/common_sub_flow.py index d71dcd0cb4..bcd3df83e2 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/common_sub_flow.py @@ -11,7 +11,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterEntryType, ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_add_slave.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_add_slave.py index 86cf512e6b..d11eabf4af 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_add_slave.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_add_slave.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType, InstanceRole from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_backup_dbs.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_backup_dbs.py index 8e6a41b57e..b53f9438a7 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_backup_dbs.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_backup_dbs.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_clean_dbs.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_clean_dbs.py index f0fb019f6f..0bdcaa7ca1 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_clean_dbs.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_clean_dbs.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_destroy.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_destroy.py index b206c0efff..7b55aa7f31 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_destroy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_destroy.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_disable.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_disable.py index 254803b295..cb9dd46bb3 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_disable.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_disable.py @@ -13,7 +13,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models import Cluster from backend.flow.consts import SqlserverLoginExecMode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_enable.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_enable.py index c622526d96..04c3c97d58 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_enable.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_enable.py @@ -13,7 +13,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models import Cluster from backend.flow.consts import SqlserverLoginExecMode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_reset.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_reset.py index 8fd3dd67d2..17d1485a8f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_reset.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_cluster_reset.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_ha_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_ha_deploy.py index 6a574afb05..dda0f37049 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_ha_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_ha_deploy.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType from backend.flow.consts import SqlserverSyncMode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_master_slave_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_master_slave_switch.py index 182196bb3a..549b165eb2 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_master_slave_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_master_slave_switch.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_rename_dbs.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_rename_dbs.py index f3d21c27f1..6f0798d5e3 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_rename_dbs.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_rename_dbs.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterType, InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_single_deploy.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_single_deploy.py index b53b19f6e0..e5cf353ea0 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_single_deploy.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_single_deploy.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_slave_rebuild.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_slave_rebuild.py index c1a2da5c2c..2f1d42ffa4 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_slave_rebuild.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_slave_rebuild.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import ClusterEntryType, ClusterType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_sql_execute.py b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_sql_execute.py index c154bd6277..7cc4634102 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_sql_execute.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/sqlserver/sqlserver_sql_execute.py @@ -12,7 +12,7 @@ import logging.config from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/add_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/add_nodes.py index b534efbfa4..0017d2e74a 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/add_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/add_nodes.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import InstanceRole from backend.flow.consts import TBinlogDumperAddType diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/common_sub_flow.py index 7b6570b0a6..b8b0b28346 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/common_sub_flow.py @@ -11,7 +11,7 @@ import uuid from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/exceptions.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/exceptions.py index 7c02b60c5d..f07649030b 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/exceptions.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/exceptions.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/util.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/util.py index cab67b9255..5ed6a3d948 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/util.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/common/util.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DRSApi from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/disable_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/disable_nodes.py index ad2e86bc4b..640de27c54 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/disable_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/disable_nodes.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models.extra_process import ExtraProcessInstance from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/enable_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/enable_nodes.py index 1559018888..6ccbd15d72 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/enable_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/enable_nodes.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models.extra_process import ExtraProcessInstance from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/reduce_node.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/reduce_node.py index 967a456d7f..bde999876d 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/reduce_node.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/reduce_node.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Dict, Optional -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.bamboo.scene.common.builder import Builder, SubBuilder from backend.flow.engine.bamboo.scene.tbinlogdumper.common.common_sub_flow import reduce_tbinlogdumper_sub_flow diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/switch_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/switch_nodes.py index 269bfe1115..f669ffd592 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/switch_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/tbinlogdumper/switch_nodes.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import Any, Dict, List, Optional, Tuple, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.core.encrypt.constants import AsymmetricCipherConfigType from backend.core.encrypt.handlers import AsymmetricHandler diff --git a/dbm-ui/backend/flow/engine/exceptions.py b/dbm-ui/backend/flow/engine/exceptions.py index b3c088d872..b1f5f6c0be 100644 --- a/dbm-ui/backend/flow/engine/exceptions.py +++ b/dbm-ui/backend/flow/engine/exceptions.py @@ -10,7 +10,7 @@ """ from typing import Any -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.exceptions import AppBaseException diff --git a/dbm-ui/backend/flow/models.py b/dbm-ui/backend/flow/models.py index de86e122b7..c1085f7de4 100644 --- a/dbm-ui/backend/flow/models.py +++ b/dbm-ui/backend/flow/models.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.consts import StateType from backend.ticket.constants import TicketType diff --git a/dbm-ui/backend/flow/plugins/components/collections/cloud/exec_service_script.py b/dbm-ui/backend/flow/plugins/components/collections/cloud/exec_service_script.py index 4f99c9d5fa..b55cc2d625 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/cloud/exec_service_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/cloud/exec_service_script.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/cloud/push_config_file.py b/dbm-ui/backend/flow/plugins/components/collections/cloud/push_config_file.py index 1986e23c57..1a0410a548 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/cloud/push_config_file.py +++ b/dbm-ui/backend/flow/plugins/components/collections/cloud/push_config_file.py @@ -12,7 +12,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component diff --git a/dbm-ui/backend/flow/plugins/components/collections/cloud/trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/cloud/trans_files.py index 7ff55c58ba..dc2bff4d97 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/cloud/trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/cloud/trans_files.py @@ -13,7 +13,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/L5_agent_install.py b/dbm-ui/backend/flow/plugins/components/collections/common/L5_agent_install.py index 7408d853b1..68d0af4b36 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/L5_agent_install.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/L5_agent_install.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py index a511d83db6..bb0957f33e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/base_service.py @@ -17,7 +17,7 @@ from bamboo_engine import states from django.utils import translation -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.core.flow.activity import Service, StaticIntervalGenerator from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/bigdata_manager_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/bigdata_manager_service.py index 516e0f90eb..531a138323 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/bigdata_manager_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/bigdata_manager_service.py @@ -1,7 +1,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/check_resolv_conf.py b/dbm-ui/backend/flow/plugins/components/collections/common/check_resolv_conf.py index 756da4e724..0a72ab335a 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/check_resolv_conf.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/check_resolv_conf.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/clb_manage.py b/dbm-ui/backend/flow/plugins/components/collections/common/clb_manage.py index 350c2e4ab1..158688a034 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/clb_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/clb_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/create_random_job_user.py b/dbm-ui/backend/flow/plugins/components/collections/common/create_random_job_user.py index 362caf73ec..65805f81e8 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/create_random_job_user.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/create_random_job_user.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.mysql_priv_manager.client import DBPrivManagerApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/create_ticket.py b/dbm-ui/backend/flow/plugins/components/collections/common/create_ticket.py index 82471571a6..9ed9e8073f 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/create_ticket.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/create_ticket.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/dns_server.py b/dbm-ui/backend/flow/plugins/components/collections/common/dns_server.py index c28183fbd4..78e833daf1 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/dns_server.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/dns_server.py @@ -12,7 +12,7 @@ import random from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/drop_random_job_user.py b/dbm-ui/backend/flow/plugins/components/collections/common/drop_random_job_user.py index 119e50ee47..c78bb44d07 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/drop_random_job_user.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/drop_random_job_user.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/external_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/external_service.py index 502cd01de6..07d9def6be 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/external_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/external_service.py @@ -12,7 +12,7 @@ import importlib from typing import Any, Callable, Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.exceptions import ApiRequestError, ApiResultError diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/pause.py b/dbm-ui/backend/flow/plugins/components/collections/common/pause.py index 55e157e496..d9d354b9f1 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/pause.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/pause.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.io import ObjectItemSchema, StringItemSchema diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/polaris_manage.py b/dbm-ui/backend/flow/plugins/components/collections/common/polaris_manage.py index fc3feb9179..8f00398a7e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/polaris_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/polaris_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/sa_idle_check.py b/dbm-ui/backend/flow/plugins/components/collections/common/sa_idle_check.py index 593f1dcea2..0482d74660 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/sa_idle_check.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/sa_idle_check.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/sa_init.py b/dbm-ui/backend/flow/plugins/components/collections/common/sa_init.py index fcc0b08e8f..b12c0fb96a 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/sa_init.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/sa_init.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/sleep_time_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/sleep_time_service.py index 67a28d10ea..67b36ea5f6 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/sleep_time_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/sleep_time_service.py @@ -13,7 +13,7 @@ import re from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator from pipeline.core.flow.io import StringItemSchema diff --git a/dbm-ui/backend/flow/plugins/components/collections/common/transfer_host_service.py b/dbm-ui/backend/flow/plugins/components/collections/common/transfer_host_service.py index 25e8fcc2d4..726c3fbcc8 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/common/transfer_host_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/common/transfer_host_service.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/es/es_dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/es/es_dns_manage.py index c457b8bc06..e4030fc37e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/es/es_dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/es/es_dns_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/es/exec_es_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/es/exec_es_actuator_script.py index 0e3fd98bc7..ca7ee53701 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/es/exec_es_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/es/exec_es_actuator_script.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/es/get_es_resource.py b/dbm-ui/backend/flow/plugins/components/collections/es/get_es_resource.py index c44ba82731..3252ba3536 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/es/get_es_resource.py +++ b/dbm-ui/backend/flow/plugins/components/collections/es/get_es_resource.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/es/trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/es/trans_files.py index 2e6ba2249c..ea82686e6e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/es/trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/es/trans_files.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/hdfs/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/hdfs/exec_actuator_script.py index 70ffb7ab1c..41208bab9a 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/hdfs/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/hdfs/exec_actuator_script.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/hdfs/get_hdfs_resource.py b/dbm-ui/backend/flow/plugins/components/collections/hdfs/get_hdfs_resource.py index e5cf10e0c9..24a428c4c4 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/hdfs/get_hdfs_resource.py +++ b/dbm-ui/backend/flow/plugins/components/collections/hdfs/get_hdfs_resource.py @@ -10,7 +10,7 @@ """ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/hdfs/hdfs_dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/hdfs/hdfs_dns_manage.py index 89c85c0353..46dd07cf3d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/hdfs/hdfs_dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/hdfs/hdfs_dns_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/hdfs/trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/hdfs/trans_flies.py index 54dd605a20..edccf49233 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/hdfs/trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/hdfs/trans_flies.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/hdfs/update_hdfs_resource.py b/dbm-ui/backend/flow/plugins/components/collections/hdfs/update_hdfs_resource.py index ea05fd30fa..3c8ec22d96 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/hdfs/update_hdfs_resource.py +++ b/dbm-ui/backend/flow/plugins/components/collections/hdfs/update_hdfs_resource.py @@ -10,7 +10,7 @@ """ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/influxdb/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/influxdb/exec_actuator_script.py index 68ec7c61a2..7019b87bf0 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/influxdb/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/influxdb/exec_actuator_script.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/influxdb/trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/influxdb/trans_flies.py index c44b58bb0c..23b98289d1 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/influxdb/trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/influxdb/trans_flies.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/kafka/dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/kafka/dns_manage.py index 1f0857364b..c4b7807d4b 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/kafka/dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/kafka/dns_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/kafka/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/kafka/exec_actuator_script.py index 68ec7c61a2..7019b87bf0 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/kafka/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/kafka/exec_actuator_script.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/kafka/get_kafka_resource.py b/dbm-ui/backend/flow/plugins/components/collections/kafka/get_kafka_resource.py index 06f275e2db..5b127fe3eb 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/kafka/get_kafka_resource.py +++ b/dbm-ui/backend/flow/plugins/components/collections/kafka/get_kafka_resource.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/kafka/trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/kafka/trans_flies.py index a6d05e29b6..5b60be9f22 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/kafka/trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/kafka/trans_flies.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job.py index 8118febffd..016fa42b8d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job.py @@ -14,7 +14,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job2.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job2.py index 9a4c8c2728..b961d08591 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job2.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/exec_actuator_job2.py @@ -15,7 +15,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/fast_exec_script.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/fast_exec_script.py index 869eeb989b..9c1dd349d8 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/fast_exec_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/fast_exec_script.py @@ -13,7 +13,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_download_backup_files.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_download_backup_files.py index d13d7a3a7a..3def42fae7 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_download_backup_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_download_backup_files.py @@ -11,7 +11,7 @@ import logging.config -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py index e0c41194fd..6cae7eb8d1 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py @@ -15,7 +15,7 @@ from typing import Dict, List from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/send_media.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/send_media.py index 37c257f51b..efb733deae 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/send_media.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/send_media.py @@ -12,7 +12,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py index de344ca940..2fe76233f2 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/authorize_rules.py @@ -12,7 +12,7 @@ import logging from typing import Any, Dict, List, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/build_database_table_filter_regex.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/build_database_table_filter_regex.py index e73472cfb5..f4a26ed84c 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/build_database_table_filter_regex.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/build_database_table_filter_regex.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.consts import ROLLBACK_DB_TAIL, STAGE_DB_HEADER, SYSTEM_DBS diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/clear_machine.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/clear_machine.py index 23101edb0e..ef97f7f1c8 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/clear_machine.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/clear_machine.py @@ -11,7 +11,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_rules.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_rules.py index d381c64d88..b0730c83a0 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_rules.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_rules.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_user.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_user.py index d4ad2457ef..00604d5bc5 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_user.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/clone_user.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/cluster_standardize_trans_module.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/cluster_standardize_trans_module.py index 74709b59b0..beda9fc1e4 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/cluster_standardize_trans_module.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/cluster_standardize_trans_module.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/create_user.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/create_user.py index 9f018044ae..4940018518 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/create_user.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/create_user.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DBPrivManagerApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/dns_manage.py index 39d8e0469b..4552315e23 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/dns_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/drop_user.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/drop_user.py index 3ae83d9b10..eefb67e8d4 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/drop_user.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/drop_user.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/exec_actuator_script.py index 7be43b6e01..e89d00a93f 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/exec_actuator_script.py @@ -15,7 +15,7 @@ from dataclasses import asdict, is_dataclass from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/fake_semantic_check.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/fake_semantic_check.py index 81daf54ad3..0966d2421b 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/fake_semantic_check.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/fake_semantic_check.py @@ -12,7 +12,7 @@ import time from django.core.cache import cache -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_services.mysql.sql_import.constants import ( diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_from_regex.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_from_regex.py index d5df5fa3d6..20028d67cb 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_from_regex.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/filter_database_table_from_regex.py @@ -10,7 +10,7 @@ """ import re -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_checksum_report.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_checksum_report.py index da346f1318..901ef8d68e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_checksum_report.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_checksum_report.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_cluster_instantiate_config.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_cluster_instantiate_config.py index a2bb7976d9..3a9306addb 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_cluster_instantiate_config.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_cluster_instantiate_config.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DBConfigApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_db_meta.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_db_meta.py index c987b120e0..8926da57e3 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_db_meta.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_db_meta.py @@ -12,7 +12,7 @@ import logging from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py index 8b24c7fd09..804bf86356 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py index 8d2521fd55..6de6e79415 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_import_metadata.py @@ -13,7 +13,7 @@ from typing import Dict, List, Optional, Union from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_meta.enums import ( diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py index 253a0af415..56a8489e2d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_ha_modify_cluster_phase.py @@ -11,7 +11,7 @@ from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_meta.enums import ClusterPhase, InstancePhase diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_link_backup_id_bill_id.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_link_backup_id_bill_id.py index b768b7bba5..c295cdb8c9 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_link_backup_id_bill_id.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_link_backup_id_bill_id.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_master_slave_relationship_check.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_master_slave_relationship_check.py index 354d68ad75..a4c683bc20 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_master_slave_relationship_check.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_master_slave_relationship_check.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.core.exceptions import ObjectDoesNotExist -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.constants import IP_PORT_DIVIDER diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_rollback_data_download_binlog.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_rollback_data_download_binlog.py index ab84c0f038..c56341c164 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_rollback_data_download_binlog.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_rollback_data_download_binlog.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/randomize_admin_password.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/randomize_admin_password.py index e07859781a..4e01198566 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/randomize_admin_password.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/randomize_admin_password.py @@ -10,7 +10,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DBPrivManagerApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_confirm_empty_from.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_confirm_empty_from.py index 4361d8e78b..622740f579 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_confirm_empty_from.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_confirm_empty_from.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_drop_from.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_drop_from.py index 585572b3e1..99b51ac90c 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_drop_from.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_drop_from.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_prepare_param.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_prepare_param.py index 5c0d31fd03..8e729fb712 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_prepare_param.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/rename_database_prepare_param.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/rollback_trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/rollback_trans_flies.py index ae4736381d..16e445ba66 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/rollback_trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/rollback_trans_flies.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py index 6c87663f3e..1bde2ea38a 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/semantic_check.py @@ -11,7 +11,7 @@ import logging from django.core.cache import cache -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/slave_trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/slave_trans_flies.py index b0444cee4c..b984898e5d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/slave_trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/slave_trans_flies.py @@ -11,7 +11,7 @@ import json import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileService diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/trans_flies.py index a846b35521..4eaf2133e2 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/trans_flies.py @@ -11,7 +11,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_create_stage_database.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_create_stage_database.py index 313ad4f341..5ef9554e09 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_create_stage_database.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_create_stage_database.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_drop_stage_database.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_drop_stage_database.py index ed4b7c211b..3b67788a62 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_drop_stage_database.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_drop_stage_database.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_generate_stage_database_name.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_generate_stage_database_name.py index cb08a082e6..446e4c2f04 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_generate_stage_database_name.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_generate_stage_database_name.py @@ -10,7 +10,7 @@ """ from datetime import datetime -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.consts import STAGE_DB_HEADER diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_recreate_table.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_recreate_table.py index 0c18f0c56c..dc70cb1434 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_recreate_table.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_recreate_table.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_rename_table.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_rename_table.py index 8902b63935..86d9795526 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_rename_table.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/truncate_data_rename_table.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/upload_file.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/upload_file.py index 8cb67e5f3d..6034f60438 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/upload_file.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/upload_file.py @@ -10,7 +10,7 @@ """ import tempfile -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.core.storages.storage import get_storage diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/blank_schedule_service.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/blank_schedule_service.py index b6a69bb5af..e4cc80d436 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/pulsar/blank_schedule_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/blank_schedule_service.py @@ -11,7 +11,7 @@ import math from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow import StaticIntervalGenerator from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/exec_actuator_script.py index 27c9ae52dc..d08dbbaf88 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/pulsar/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/exec_actuator_script.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_dns_manage.py index ba27ff8cd2..892b50fd34 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_dns_manage.py @@ -10,7 +10,7 @@ """ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_zk_dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_zk_dns_manage.py index 1a2848008e..27f3c347e3 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_zk_dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/pulsar_zk_dns_manage.py @@ -10,7 +10,7 @@ """ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/pulsar/trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/pulsar/trans_files.py index bd3d65a36c..a16a631310 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/pulsar/trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/pulsar/trans_files.py @@ -11,7 +11,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/dns_manage.py b/dbm-ui/backend/flow/plugins/components/collections/redis/dns_manage.py index d4eba9c0f5..d9e457c304 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/dns_manage.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/dns_manage.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py index 14dec6d237..2609a85554 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_actuator_script.py @@ -13,7 +13,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py index 65419bdb74..96aea690f0 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_data_structure_actuator_script.py @@ -13,7 +13,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py index 7b4c91d357..34569604a5 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/exec_shell_script.py @@ -12,7 +12,7 @@ import traceback from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/get_redis_payload.py b/dbm-ui/backend/flow/plugins/components/collections/redis/get_redis_payload.py index 8d7ce4995c..19fe21cf5f 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/get_redis_payload.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/get_redis_payload.py @@ -12,7 +12,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/psuh_data_structure_json_script.py b/dbm-ui/backend/flow/plugins/components/collections/redis/psuh_data_structure_json_script.py index 772d8e9d56..7e7aee5a8c 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/psuh_data_structure_json_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/psuh_data_structure_json_script.py @@ -14,7 +14,7 @@ import re from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_db_meta.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_db_meta.py index 876e6dc859..53a6dc285d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_db_meta.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_db_meta.py @@ -13,7 +13,7 @@ from dataclasses import asdict from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py index e1fba91044..0e7022f4d9 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_download_backup_files.py @@ -11,7 +11,7 @@ import logging.config -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py index fb0d4ffac0..c3ce56cd53 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_dts.py @@ -17,7 +17,7 @@ from django.db import transaction from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service, StaticIntervalGenerator diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_ticket.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_ticket.py index 08e2aabaf0..654343e325 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_ticket.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_ticket.py @@ -10,7 +10,7 @@ """ from typing import List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py index 36fb85e684..bcc3e42c88 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/redis_trans_files.py @@ -11,7 +11,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/redis/trans_flies.py b/dbm-ui/backend/flow/plugins/components/collections/redis/trans_flies.py index 929f3afb35..b1341d8e7b 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/redis/trans_flies.py +++ b/dbm-ui/backend/flow/plugins/components/collections/redis/trans_flies.py @@ -13,7 +13,7 @@ import time from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/riak/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/riak/exec_actuator_script.py index cc2a458154..ed2d6c4901 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/riak/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/riak/exec_actuator_script.py @@ -14,7 +14,7 @@ import re from dataclasses import asdict, is_dataclass -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component diff --git a/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_cluster_node.py b/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_cluster_node.py index ac3969d0d3..70e06908ac 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_cluster_node.py +++ b/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_cluster_node.py @@ -13,7 +13,7 @@ from typing import List from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_resource.py b/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_resource.py index 84edc835cc..06c02cf644 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_resource.py +++ b/dbm-ui/backend/flow/plugins/components/collections/riak/get_riak_resource.py @@ -11,7 +11,7 @@ import logging from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service diff --git a/dbm-ui/backend/flow/plugins/components/collections/riak/trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/riak/trans_files.py index add4a093c9..9aecb4bdb4 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/riak/trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/riak/trans_files.py @@ -11,7 +11,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/add_spider_routing.py b/dbm-ui/backend/flow/plugins/components/collections/spider/add_spider_routing.py index 6a03e6bc52..88c80b090d 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/add_spider_routing.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/add_spider_routing.py @@ -8,7 +8,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pipeline.component_framework.component import Component from backend.components import DBPrivManagerApi, DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/add_system_user_in_cluster.py b/dbm-ui/backend/flow/plugins/components/collections/spider/add_system_user_in_cluster.py index 0eadcd7e70..45d24e1c2b 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/add_system_user_in_cluster.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/add_system_user_in_cluster.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components import DBPrivManagerApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/check_cluster_table_using_sub.py b/dbm-ui/backend/flow/plugins/components/collections/spider/check_cluster_table_using_sub.py index bc54eee3c4..776de22ef5 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/check_cluster_table_using_sub.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/check_cluster_table_using_sub.py @@ -11,7 +11,7 @@ import logging from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models import Cluster from backend.flow.consts import TruncateDataTypeEnum diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/clear_database_on_remote_service.py b/dbm-ui/backend/flow/plugins/components/collections/spider/clear_database_on_remote_service.py index 5404adadb0..ee2c214414 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/clear_database_on_remote_service.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/clear_database_on_remote_service.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/create_database_like_via_ctl.py b/dbm-ui/backend/flow/plugins/components/collections/spider/create_database_like_via_ctl.py index 2a8a768879..cd236966d5 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/create_database_like_via_ctl.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/create_database_like_via_ctl.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_drop_routing.py b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_drop_routing.py index 4dd76340b0..705f3fbdad 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_drop_routing.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_drop_routing.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py index 928f6f60e2..cf762a6100 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/ctl_switch_to_slave.py @@ -9,7 +9,7 @@ """ from time import sleep -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pipeline.component_framework.component import Component from backend.components import DBConfigApi, DBPrivManagerApi, DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_ronting.py b/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_ronting.py index 485a3a0f92..71dcf3a697 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_ronting.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_ronting.py @@ -7,7 +7,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pipeline.component_framework.component import Component from backend.components import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_table_via_ctl.py b/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_table_via_ctl.py index 57cb233560..cd03c6be85 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_table_via_ctl.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/drop_spider_table_via_ctl.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/import_metadata.py b/dbm-ui/backend/flow/plugins/components/collections/spider/import_metadata.py index 9de2fb8cfe..e418a42c93 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/import_metadata.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/import_metadata.py @@ -14,7 +14,7 @@ from typing import Dict, List, Tuple from django.db import transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.db_meta.enums import ( diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/spider_db_meta.py b/dbm-ui/backend/flow/plugins/components/collections/spider/spider_db_meta.py index fde17d2a09..b1916cf3e1 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/spider_db_meta.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/spider_db_meta.py @@ -11,7 +11,7 @@ import logging from dataclasses import asdict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.flow.plugins.components.collections.common.base_service import BaseService diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_drop_stage_db_via_ctl.py b/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_drop_stage_db_via_ctl.py index 599fc3c2ca..91bea8e1bf 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_drop_stage_db_via_ctl.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_drop_stage_db_via_ctl.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_on_spider_via_ctl.py b/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_on_spider_via_ctl.py index 0db91643cc..39c44699ac 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_on_spider_via_ctl.py +++ b/dbm-ui/backend/flow/plugins/components/collections/spider/truncate_database_on_spider_via_ctl.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend.components.db_remote_service.client import DRSApi diff --git a/dbm-ui/backend/flow/plugins/components/collections/sqlserver/exec_actuator_script.py b/dbm-ui/backend/flow/plugins/components/collections/sqlserver/exec_actuator_script.py index b4b39144a9..84e8a35ba6 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/sqlserver/exec_actuator_script.py +++ b/dbm-ui/backend/flow/plugins/components/collections/sqlserver/exec_actuator_script.py @@ -14,7 +14,7 @@ from dataclasses import asdict, is_dataclass from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from jinja2 import Environment from pipeline.component_framework.component import Component diff --git a/dbm-ui/backend/flow/plugins/components/collections/sqlserver/trans_files.py b/dbm-ui/backend/flow/plugins/components/collections/sqlserver/trans_files.py index 275f50c775..5225371b2b 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/sqlserver/trans_files.py +++ b/dbm-ui/backend/flow/plugins/components/collections/sqlserver/trans_files.py @@ -9,7 +9,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from pipeline.component_framework.component import Component from backend import env diff --git a/dbm-ui/backend/flow/signal/handlers.py b/dbm-ui/backend/flow/signal/handlers.py index 7403d3a355..648ce5b42f 100644 --- a/dbm-ui/backend/flow/signal/handlers.py +++ b/dbm-ui/backend/flow/signal/handlers.py @@ -12,7 +12,7 @@ from celery.task import task from django.utils import timezone -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components.cmsi.handler import CmsiHandler from backend.db_dirty.handlers import DBDirtyMachineHandler diff --git a/dbm-ui/backend/flow/utils/base/payload_handler.py b/dbm-ui/backend/flow/utils/base/payload_handler.py index 82b62c32d5..c9c922a259 100644 --- a/dbm-ui/backend/flow/utils/base/payload_handler.py +++ b/dbm-ui/backend/flow/utils/base/payload_handler.py @@ -10,18 +10,20 @@ import base64 import logging -import re +from typing import Dict + +from django.utils.translation import gettext as _ from backend import env from backend.components import DBConfigApi, DBPrivManagerApi from backend.components.dbconfig.constants import FormatType, LevelName, ReqType -from backend.constants import IP_RE_PATTERN from backend.core.encrypt.constants import AsymmetricCipherConfigType from backend.core.encrypt.handlers import AsymmetricHandler from backend.db_meta.enums import ClusterType from backend.db_meta.models import Cluster from backend.db_proxy.constants import ExtensionType from backend.db_proxy.models import DBExtension +from backend.db_services.ipchooser.constants import DEFAULT_CLOUD from backend.flow.consts import DEFAULT_INSTANCE, ConfigTypeEnum, LevelInfoEnum, MySQLPrivComponent, UserName from backend.flow.utils.mysql.get_mysql_sys_user import generate_mysql_tmp_user from backend.ticket.constants import TicketType @@ -51,7 +53,6 @@ def __init__(self, bk_cloud_id: int, ticket_data: dict, cluster: dict, cluster_t self.account = self.get_mysql_account() self.proxy_account = self.get_proxy_account() - # todo 后面可能优化这个问题 if self.ticket_data.get("module"): self.db_module_id = self.ticket_data["module"] elif self.cluster and self.cluster.get("db_module_id"): @@ -129,88 +130,70 @@ def get_mysql_account(self) -> dict: return user_map @staticmethod - def __get_super_account_bypass(): - """ - 旁路逻辑:获取环境变量中的access_hosts, 用户名和密码 - """ - access_hosts = env.TEST_ACCESS_HOSTS or re.compile(IP_RE_PATTERN).findall(env.DRS_APIGW_DOMAIN) - drs_account_data = { - "access_hosts": access_hosts, - "user": env.DRS_USERNAME, - "pwd": env.DRS_PASSWORD, - } - - access_hosts = env.TEST_ACCESS_HOSTS or re.compile(IP_RE_PATTERN).findall(env.DBHA_APIGW_DOMAIN_LIST) - dbha_account_data = { - "access_hosts": access_hosts, - "user": env.DBHA_USERNAME, - "pwd": env.DBHA_PASSWORD, - } - - return drs_account_data, dbha_account_data + def get_extension_super_account(bk_cloud_id: int, extension_type: ExtensionType) -> Dict[str, str]: + """获取扩展服务超级账号""" + # 若已部署,则从数据库中读取返回 + extension = DBExtension.get_latest_extension(bk_cloud_id=bk_cloud_id, extension_type=extension_type) + cipher_cloud_name = AsymmetricCipherConfigType.get_cipher_cloud_name(bk_cloud_id) + if extension: + return { + "access_hosts": DBExtension.get_extension_access_hosts( + bk_cloud_id=bk_cloud_id, extension_type=extension_type + ), + "pwd": AsymmetricHandler.decrypt(name=cipher_cloud_name, content=extension.details["pwd"]), + "user": AsymmetricHandler.decrypt(name=cipher_cloud_name, content=extension.details["user"]), + } + # 若未部署相关扩展服务,且非直连区域,则要求进行部署 + if bk_cloud_id != DEFAULT_CLOUD: + raise Exception(_("此云区域(bk_cloud_id:{})未部署相关套件{}".format(bk_cloud_id, extension_type))) + + # 直连区域,考虑是容器化部署的通过环境变量获取 + if extension_type == ExtensionType.DRS: + return { + "access_hosts": env.DEFAULT_CLOUD_DRS_ACCESS_HOSTS, + "user": env.DRS_USERNAME, + "pwd": env.DRS_PASSWORD, + } + elif extension_type == ExtensionType.DBHA: + return { + "access_hosts": env.DEFAULT_CLOUD_DBHA_ACCESS_HOSTS, + "user": env.DBHA_USERNAME, + "pwd": env.DBHA_PASSWORD, + } + else: + raise NotImplementedError(_("不支持{}类型扩展的账号获取").format(extension_type)) def get_super_account(self): """ 获取mysql机器系统管理账号信息 """ - - if env.DRS_USERNAME and env.DBHA_USERNAME: - return self.__get_super_account_bypass() - - bk_cloud_name = AsymmetricCipherConfigType.get_cipher_cloud_name(self.bk_cloud_id) - drs = DBExtension.get_latest_extension(bk_cloud_id=self.bk_cloud_id, extension_type=ExtensionType.DRS) - drs_account_data = { - "access_hosts": DBExtension.get_extension_access_hosts( - bk_cloud_id=self.bk_cloud_id, extension_type=ExtensionType.DRS - ), - "pwd": AsymmetricHandler.decrypt(name=bk_cloud_name, content=drs.details["pwd"]), - "user": AsymmetricHandler.decrypt(name=bk_cloud_name, content=drs.details["user"]), - } - - dbha = DBExtension.get_latest_extension(bk_cloud_id=self.bk_cloud_id, extension_type=ExtensionType.DBHA) - dbha_account_data = { - "access_hosts": DBExtension.get_extension_access_hosts( - bk_cloud_id=self.bk_cloud_id, extension_type=ExtensionType.DBHA - ), - "pwd": AsymmetricHandler.decrypt(name=bk_cloud_name, content=dbha.details["pwd"]), - "user": AsymmetricHandler.decrypt(name=bk_cloud_name, content=dbha.details["user"]), - } - + drs_account_data = self.get_extension_super_account(self.bk_cloud_id, ExtensionType.DRS) + dbha_account_data = self.get_extension_super_account(self.bk_cloud_id, ExtensionType.DBHA) return drs_account_data, dbha_account_data @staticmethod def redis_get_cluster_pass_from_dbconfig(cluster: Cluster): - proxy_conf = DBConfigApi.query_conf_item( - params={ - "bk_biz_id": str(cluster.bk_biz_id), - "level_name": LevelName.CLUSTER.value, - "level_value": cluster.immute_domain, - "level_info": {"module": str(cluster.db_module_id)}, - "conf_file": cluster.proxy_version, - "conf_type": ConfigTypeEnum.ProxyConf, - "namespace": cluster.cluster_type, - "format": FormatType.MAP, - } - ) - proxy_content = proxy_conf.get("content", {}) - - redis_conf = DBConfigApi.query_conf_item( - params={ - "bk_biz_id": str(cluster.bk_biz_id), - "level_name": LevelName.CLUSTER.value, - "level_value": cluster.immute_domain, - "level_info": {"module": str(cluster.db_module_id)}, - "conf_file": cluster.major_version, - "conf_type": ConfigTypeEnum.DBConf, - "namespace": cluster.cluster_type, - "format": FormatType.MAP, - } - ) - redis_content = redis_conf.get("content", {}) + def _redis_get_cluster_config(conf_file, conf_type): + config = DBConfigApi.query_conf_item( + params={ + "bk_biz_id": str(cluster.bk_biz_id), + "level_name": LevelName.CLUSTER.value, + "level_value": cluster.immute_domain, + "level_info": {"module": str(cluster.db_module_id)}, + "conf_file": conf_file, + "conf_type": conf_type, + "namespace": cluster.cluster_type, + "format": FormatType.MAP, + } + ) + return config.get("content", {}) + + proxy_conf = _redis_get_cluster_config(cluster.proxy_version, ConfigTypeEnum.ProxyConf) + redis_conf = _redis_get_cluster_config(cluster.major_version, ConfigTypeEnum.DBConf) return { - "redis_password": redis_content.get("requirepass", ""), - "redis_proxy_password": proxy_content.get("password", ""), - "redis_proxy_admin_password": proxy_content.get("predixy_admin_passwd", ""), + "redis_password": redis_conf.get("requirepass", ""), + "redis_proxy_password": proxy_conf.get("password", ""), + "redis_proxy_admin_password": proxy_conf.get("predixy_admin_passwd", ""), } @staticmethod diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py b/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py index d79d3324bd..a49823417a 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_act_payload.py @@ -11,7 +11,7 @@ import json import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.configuration.handlers.password import DBPasswordHandler diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py b/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py index 1805b69f90..a227ac8903 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_db_proxy.py @@ -13,7 +13,7 @@ from typing import List from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_proxy.constants import ExtensionServiceStatus, ExtensionType from backend.db_proxy.models import DBCloudProxy, DBExtension diff --git a/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py b/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py index 2d3b1e7f6f..c76cd23407 100644 --- a/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py +++ b/dbm-ui/backend/flow/utils/cloud/cloud_module_operate.py @@ -11,7 +11,7 @@ import logging from typing import Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import CCApi from backend.db_services.cmdb.biz import get_or_create_cmdb_module_with_name, get_or_create_set_with_name diff --git a/dbm-ui/backend/flow/utils/es/es_db_meta.py b/dbm-ui/backend/flow/utils/es/es_db_meta.py index f8f6d12794..10871ee45e 100644 --- a/dbm-ui/backend/flow/utils/es/es_db_meta.py +++ b/dbm-ui/backend/flow/utils/es/es_db_meta.py @@ -11,7 +11,7 @@ import logging from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import api from backend.db_meta.enums import InstanceRole, MachineType diff --git a/dbm-ui/backend/flow/utils/hdfs/hdfs_db_meta.py b/dbm-ui/backend/flow/utils/hdfs/hdfs_db_meta.py index 10d6b4224c..834a8d97b3 100644 --- a/dbm-ui/backend/flow/utils/hdfs/hdfs_db_meta.py +++ b/dbm-ui/backend/flow/utils/hdfs/hdfs_db_meta.py @@ -11,7 +11,7 @@ import logging from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import api from backend.db_meta.enums import InstanceRole, MachineType diff --git a/dbm-ui/backend/flow/utils/influxdb/influxdb_db_meta.py b/dbm-ui/backend/flow/utils/influxdb/influxdb_db_meta.py index b0d8744e34..7d28f90ff3 100644 --- a/dbm-ui/backend/flow/utils/influxdb/influxdb_db_meta.py +++ b/dbm-ui/backend/flow/utils/influxdb/influxdb_db_meta.py @@ -11,7 +11,7 @@ import logging from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import api from backend.db_meta.enums import InstanceRole, MachineType diff --git a/dbm-ui/backend/flow/utils/kafka/kafka_db_meta.py b/dbm-ui/backend/flow/utils/kafka/kafka_db_meta.py index 0ac5ff798d..f8d6c2c01e 100644 --- a/dbm-ui/backend/flow/utils/kafka/kafka_db_meta.py +++ b/dbm-ui/backend/flow/utils/kafka/kafka_db_meta.py @@ -11,7 +11,7 @@ import logging from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta import api from backend.db_meta.enums import InstanceRole, MachineType diff --git a/dbm-ui/backend/flow/utils/mongodb/db_table_filter.py b/dbm-ui/backend/flow/utils/mongodb/db_table_filter.py index 9b50e0a8ad..a82bddbbbf 100644 --- a/dbm-ui/backend/flow/utils/mongodb/db_table_filter.py +++ b/dbm-ui/backend/flow/utils/mongodb/db_table_filter.py @@ -11,7 +11,7 @@ import re from typing import List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.utils.mysql.db_table_filter.exception import DbTableFilterValidateException diff --git a/dbm-ui/backend/flow/utils/mysql/db_resource.py b/dbm-ui/backend/flow/utils/mysql/db_resource.py index 7460512853..ac02f06bb6 100644 --- a/dbm-ui/backend/flow/utils/mysql/db_resource.py +++ b/dbm-ui/backend/flow/utils/mysql/db_resource.py @@ -13,7 +13,7 @@ from typing import Dict, List, Optional import requests -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.consts import MediumEnum, RDMSApplyEnum from backend.ticket.constants import TicketType diff --git a/dbm-ui/backend/flow/utils/mysql/db_table_filter/exception.py b/dbm-ui/backend/flow/utils/mysql/db_table_filter/exception.py index 24467ab6fe..2e04a270bb 100644 --- a/dbm-ui/backend/flow/utils/mysql/db_table_filter/exception.py +++ b/dbm-ui/backend/flow/utils/mysql/db_table_filter/exception.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/flow/utils/mysql/db_table_filter/filter.py b/dbm-ui/backend/flow/utils/mysql/db_table_filter/filter.py index 1a9bc70a14..bcee94693f 100644 --- a/dbm-ui/backend/flow/utils/mysql/db_table_filter/filter.py +++ b/dbm-ui/backend/flow/utils/mysql/db_table_filter/filter.py @@ -11,7 +11,7 @@ import itertools from typing import List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from .exception import DbTableFilterValidateException from .tools import build_exclude_regexp, build_include_regexp, glob_check, replace_glob diff --git a/dbm-ui/backend/flow/utils/mysql/db_table_filter/tools.py b/dbm-ui/backend/flow/utils/mysql/db_table_filter/tools.py index d7acd24f87..72d1b23b03 100644 --- a/dbm-ui/backend/flow/utils/mysql/db_table_filter/tools.py +++ b/dbm-ui/backend/flow/utils/mysql/db_table_filter/tools.py @@ -11,7 +11,7 @@ import re from typing import List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from .exception import DbTableFilterValidateException diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_dataclass_validator.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_dataclass_validator.py index 64d79e68f6..6ec0997857 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_dataclass_validator.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_dataclass_validator.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ """ 这里定义的活动节点传入私用变量参数时做数据校验的方法 diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index e6c8bed97c..1437728b4d 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -14,7 +14,7 @@ from typing import Any, List from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import DBConfigApi diff --git a/dbm-ui/backend/flow/utils/redis/redis_act_playload.py b/dbm-ui/backend/flow/utils/redis/redis_act_playload.py index 5865d97d66..b644e9b7a8 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_act_playload.py +++ b/dbm-ui/backend/flow/utils/redis/redis_act_playload.py @@ -11,10 +11,9 @@ import copy import json import logging.config -import time from typing import Any -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.components import DBConfigApi @@ -392,7 +391,6 @@ def dts_swap_redis_config(self, cluster_map: dict): upsert_param["level_value"] = cluster_map["dst_cluster_domain"] logger.info(_("删除目标集群:{} redis配置,upsert_param:{}").format(cluster_map["dst_cluster_domain"], upsert_param)) DBConfigApi.upsert_conf_item(upsert_param) - time.sleep(2) # 源集群 写入目标集群的配置,除了 dst_conf_items 以外,其他conf_items基本用默认值 upsert_param["conf_file_info"]["namespace"] = cluster_map["dst_cluster_type"] upsert_param["conf_file_info"]["conf_file"] = cluster_map["dst_cluster_version"] @@ -633,8 +631,6 @@ def dts_swap_proxy_config(self, cluster_map: dict) -> Any: ) DBConfigApi.upsert_conf_item(dst_remove_param) - time.sleep(2) - # 更新源集群的proxy版本、集群类型等信息 src_upsert_param = copy.deepcopy(upsert_param) src_upsert_param["conf_file_info"]["conf_file"] = cluster_map["dst_proxy_version"] diff --git a/dbm-ui/backend/flow/utils/redis/redis_db_meta.py b/dbm-ui/backend/flow/utils/redis/redis_db_meta.py index a3157ff655..905f28e07d 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_db_meta.py +++ b/dbm-ui/backend/flow/utils/redis/redis_db_meta.py @@ -15,7 +15,7 @@ from django.db import transaction from django.db.transaction import atomic -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py b/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py index 669bf451da..b7ef60d1f4 100644 --- a/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py +++ b/dbm-ui/backend/flow/utils/redis/redis_proxy_util.py @@ -15,7 +15,7 @@ from collections import defaultdict from typing import Any, Dict, List, Tuple -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi, DRSApi from backend.components.dbconfig.constants import FormatType, LevelName, OpType, ReqType diff --git a/dbm-ui/backend/flow/utils/spider/get_spider_incr.py b/dbm-ui/backend/flow/utils/spider/get_spider_incr.py index 4dea960291..c8f0a6ff1c 100644 --- a/dbm-ui/backend/flow/utils/spider/get_spider_incr.py +++ b/dbm-ui/backend/flow/utils/spider/get_spider_incr.py @@ -10,7 +10,7 @@ import copy import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.components import DRSApi from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/flow/utils/sqlserver/payload_handler.py b/dbm-ui/backend/flow/utils/sqlserver/payload_handler.py index 82dbd33c7b..1a2303680a 100644 --- a/dbm-ui/backend/flow/utils/sqlserver/payload_handler.py +++ b/dbm-ui/backend/flow/utils/sqlserver/payload_handler.py @@ -13,39 +13,29 @@ from django.utils.crypto import get_random_string -from backend import env from backend.components import DBPrivManagerApi -from backend.core.encrypt.constants import AsymmetricCipherConfigType -from backend.core.encrypt.handlers import AsymmetricHandler from backend.db_proxy.constants import ExtensionType -from backend.db_proxy.models import DBExtension from backend.flow.consts import DEFAULT_INSTANCE, MSSQL_ADMIN, MSSQL_EXPORTER, SqlserverComponent, SqlserverUserName +from backend.flow.utils.base.payload_handler import PayloadHandler as BasePayloadHandler from backend.flow.utils.mysql.get_mysql_sys_user import generate_mysql_tmp_user logger = logging.getLogger("flow") -class PayloadHandler(object): +class PayloadHandler(BasePayloadHandler): def __init__(self, global_data: dict): """ @param global_data 流程/子流程全局信息 """ self.global_data = global_data - @staticmethod - def get_sqlserver_drs_account(bk_cloud_id: int): + @classmethod + def get_sqlserver_drs_account(cls, bk_cloud_id: int): """ 获取sqlserver在drs的admin账号密码 """ - if env.DRS_USERNAME: - return {"drs_user": env.DRS_USERNAME, "drs_pwd": env.DRS_PASSWORD} - - bk_cloud_name = AsymmetricCipherConfigType.get_cipher_cloud_name(bk_cloud_id) - drs = DBExtension.get_latest_extension(bk_cloud_id=bk_cloud_id, extension_type=ExtensionType.DRS) - return { - "drs_user": AsymmetricHandler.decrypt(name=bk_cloud_name, content=drs.details["user"]), - "drs_pwd": AsymmetricHandler.decrypt(name=bk_cloud_name, content=drs.details["pwd"]), - } + drs_account = cls.get_extension_super_account(bk_cloud_id, ExtensionType.DRS) + return {"drs_user": drs_account["user"], "drs_pwd": drs_account["pwd"]} def get_sqlserver_account(self): """ diff --git a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_act_payload.py b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_act_payload.py index 39055a5e14..b65c5e1545 100644 --- a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_act_payload.py +++ b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_act_payload.py @@ -10,7 +10,7 @@ import copy import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_package.models import Package diff --git a/dbm-ui/backend/flow/utils/tbinlogdumper/tbinlogdumper_act_payload.py b/dbm-ui/backend/flow/utils/tbinlogdumper/tbinlogdumper_act_payload.py index e88389ca8b..1c302e3a10 100644 --- a/dbm-ui/backend/flow/utils/tbinlogdumper/tbinlogdumper_act_payload.py +++ b/dbm-ui/backend/flow/utils/tbinlogdumper/tbinlogdumper_act_payload.py @@ -11,7 +11,7 @@ import json import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.components import DBConfigApi from backend.components.dbconfig.constants import FormatType, LevelName diff --git a/dbm-ui/backend/flow/views/append_deploy_ctl.py b/dbm-ui/backend/flow/views/append_deploy_ctl.py index 08fc81d3fd..979490d352 100644 --- a/dbm-ui/backend/flow/views/append_deploy_ctl.py +++ b/dbm-ui/backend/flow/views/append_deploy_ctl.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/base.py b/dbm-ui/backend/flow/views/base.py index 24e441fdd3..35d69e06df 100644 --- a/dbm-ui/backend/flow/views/base.py +++ b/dbm-ui/backend/flow/views/base.py @@ -13,7 +13,7 @@ from blueapps.account.decorators import login_exempt from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.exceptions import PermissionDenied from rest_framework.permissions import AllowAny from rest_framework.views import APIView diff --git a/dbm-ui/backend/flow/views/cloud_dbha_apply.py b/dbm-ui/backend/flow/views/cloud_dbha_apply.py index 6b8f20ba4d..7b0ca6af84 100644 --- a/dbm-ui/backend/flow/views/cloud_dbha_apply.py +++ b/dbm-ui/backend/flow/views/cloud_dbha_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/flow/views/cloud_dns_bind_apply.py b/dbm-ui/backend/flow/views/cloud_dns_bind_apply.py index c88f6cb5ca..6194c2b60e 100644 --- a/dbm-ui/backend/flow/views/cloud_dns_bind_apply.py +++ b/dbm-ui/backend/flow/views/cloud_dns_bind_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/flow/views/cloud_drs_apply.py b/dbm-ui/backend/flow/views/cloud_drs_apply.py index 5a1f3956db..e6348fae2c 100644 --- a/dbm-ui/backend/flow/views/cloud_drs_apply.py +++ b/dbm-ui/backend/flow/views/cloud_drs_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/flow/views/cloud_nginx_apply.py b/dbm-ui/backend/flow/views/cloud_nginx_apply.py index d36cb43ef5..7a11187392 100644 --- a/dbm-ui/backend/flow/views/cloud_nginx_apply.py +++ b/dbm-ui/backend/flow/views/cloud_nginx_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py b/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py index 7263dc9470..edfc7dea8d 100644 --- a/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py +++ b/dbm-ui/backend/flow/views/cloud_redis_dts_server_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/flow/views/es_apply.py b/dbm-ui/backend/flow/views/es_apply.py index 6923c431a4..0fa594c2eb 100644 --- a/dbm-ui/backend/flow/views/es_apply.py +++ b/dbm-ui/backend/flow/views/es_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_destroy.py b/dbm-ui/backend/flow/views/es_destroy.py index e97f4a0385..ce856187d5 100644 --- a/dbm-ui/backend/flow/views/es_destroy.py +++ b/dbm-ui/backend/flow/views/es_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_disable.py b/dbm-ui/backend/flow/views/es_disable.py index f4ee027ebe..335e89f370 100644 --- a/dbm-ui/backend/flow/views/es_disable.py +++ b/dbm-ui/backend/flow/views/es_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_enable.py b/dbm-ui/backend/flow/views/es_enable.py index 9db3bfb2f2..c0522da98c 100644 --- a/dbm-ui/backend/flow/views/es_enable.py +++ b/dbm-ui/backend/flow/views/es_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_reboot.py b/dbm-ui/backend/flow/views/es_reboot.py index a597112669..95f601595e 100644 --- a/dbm-ui/backend/flow/views/es_reboot.py +++ b/dbm-ui/backend/flow/views/es_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_replace.py b/dbm-ui/backend/flow/views/es_replace.py index cfbad1128b..feb081ba99 100644 --- a/dbm-ui/backend/flow/views/es_replace.py +++ b/dbm-ui/backend/flow/views/es_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_scale_up.py b/dbm-ui/backend/flow/views/es_scale_up.py index 245e7b1088..ebf921958e 100644 --- a/dbm-ui/backend/flow/views/es_scale_up.py +++ b/dbm-ui/backend/flow/views/es_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/es_shrink.py b/dbm-ui/backend/flow/views/es_shrink.py index 46735fb4fb..59d204c1d3 100644 --- a/dbm-ui/backend/flow/views/es_shrink.py +++ b/dbm-ui/backend/flow/views/es_shrink.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/flow/views/hdfs_apply.py b/dbm-ui/backend/flow/views/hdfs_apply.py index 392605d82f..61eb72b2a7 100644 --- a/dbm-ui/backend/flow/views/hdfs_apply.py +++ b/dbm-ui/backend/flow/views/hdfs_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_destroy.py b/dbm-ui/backend/flow/views/hdfs_destroy.py index 4ac078ce08..e662032b56 100644 --- a/dbm-ui/backend/flow/views/hdfs_destroy.py +++ b/dbm-ui/backend/flow/views/hdfs_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_disable.py b/dbm-ui/backend/flow/views/hdfs_disable.py index 423f8c1387..3e03003ae0 100644 --- a/dbm-ui/backend/flow/views/hdfs_disable.py +++ b/dbm-ui/backend/flow/views/hdfs_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_enable.py b/dbm-ui/backend/flow/views/hdfs_enable.py index 4d1ae55c81..0e7b326b32 100644 --- a/dbm-ui/backend/flow/views/hdfs_enable.py +++ b/dbm-ui/backend/flow/views/hdfs_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_reboot.py b/dbm-ui/backend/flow/views/hdfs_reboot.py index 7effc0c24c..ea6a617794 100644 --- a/dbm-ui/backend/flow/views/hdfs_reboot.py +++ b/dbm-ui/backend/flow/views/hdfs_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_replace.py b/dbm-ui/backend/flow/views/hdfs_replace.py index e9541a701f..0002dd39c6 100644 --- a/dbm-ui/backend/flow/views/hdfs_replace.py +++ b/dbm-ui/backend/flow/views/hdfs_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_scale_up.py b/dbm-ui/backend/flow/views/hdfs_scale_up.py index 6064af137d..5a10605d63 100644 --- a/dbm-ui/backend/flow/views/hdfs_scale_up.py +++ b/dbm-ui/backend/flow/views/hdfs_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/hdfs_shrink.py b/dbm-ui/backend/flow/views/hdfs_shrink.py index 1a93cb0309..4f28393431 100644 --- a/dbm-ui/backend/flow/views/hdfs_shrink.py +++ b/dbm-ui/backend/flow/views/hdfs_shrink.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/flow/views/influxdb_apply.py b/dbm-ui/backend/flow/views/influxdb_apply.py index 19f415220f..263cd4b7ae 100644 --- a/dbm-ui/backend/flow/views/influxdb_apply.py +++ b/dbm-ui/backend/flow/views/influxdb_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/influxdb_destroy.py b/dbm-ui/backend/flow/views/influxdb_destroy.py index 36e6315536..a10149999a 100644 --- a/dbm-ui/backend/flow/views/influxdb_destroy.py +++ b/dbm-ui/backend/flow/views/influxdb_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/influxdb_disable.py b/dbm-ui/backend/flow/views/influxdb_disable.py index 1864dea507..c982c98219 100644 --- a/dbm-ui/backend/flow/views/influxdb_disable.py +++ b/dbm-ui/backend/flow/views/influxdb_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/influxdb_enable.py b/dbm-ui/backend/flow/views/influxdb_enable.py index 719d86abb3..ecde9123ba 100644 --- a/dbm-ui/backend/flow/views/influxdb_enable.py +++ b/dbm-ui/backend/flow/views/influxdb_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/influxdb_reboot.py b/dbm-ui/backend/flow/views/influxdb_reboot.py index 40191c22c2..d8a12575a7 100644 --- a/dbm-ui/backend/flow/views/influxdb_reboot.py +++ b/dbm-ui/backend/flow/views/influxdb_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/influxdb_replace.py b/dbm-ui/backend/flow/views/influxdb_replace.py index b3d60b106c..4f839922b9 100644 --- a/dbm-ui/backend/flow/views/influxdb_replace.py +++ b/dbm-ui/backend/flow/views/influxdb_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/flow/views/kafka_apply.py b/dbm-ui/backend/flow/views/kafka_apply.py index e8f88adb3e..77974f433f 100644 --- a/dbm-ui/backend/flow/views/kafka_apply.py +++ b/dbm-ui/backend/flow/views/kafka_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_destroy.py b/dbm-ui/backend/flow/views/kafka_destroy.py index d8c3c7d4d6..a95207c16b 100644 --- a/dbm-ui/backend/flow/views/kafka_destroy.py +++ b/dbm-ui/backend/flow/views/kafka_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_disable.py b/dbm-ui/backend/flow/views/kafka_disable.py index fe945af19c..22e03b9804 100644 --- a/dbm-ui/backend/flow/views/kafka_disable.py +++ b/dbm-ui/backend/flow/views/kafka_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_enable.py b/dbm-ui/backend/flow/views/kafka_enable.py index 01a195eb46..f487908bdd 100644 --- a/dbm-ui/backend/flow/views/kafka_enable.py +++ b/dbm-ui/backend/flow/views/kafka_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_reboot.py b/dbm-ui/backend/flow/views/kafka_reboot.py index c689108d3c..d6dd687f54 100644 --- a/dbm-ui/backend/flow/views/kafka_reboot.py +++ b/dbm-ui/backend/flow/views/kafka_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_replace.py b/dbm-ui/backend/flow/views/kafka_replace.py index 23a2d55df8..4042a9bc76 100644 --- a/dbm-ui/backend/flow/views/kafka_replace.py +++ b/dbm-ui/backend/flow/views/kafka_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_scale_up.py b/dbm-ui/backend/flow/views/kafka_scale_up.py index 1b0543ae9b..9c2bd3c9eb 100644 --- a/dbm-ui/backend/flow/views/kafka_scale_up.py +++ b/dbm-ui/backend/flow/views/kafka_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/kafka_shrink.py b/dbm-ui/backend/flow/views/kafka_shrink.py index a68f3a1891..92a31824e9 100644 --- a/dbm-ui/backend/flow/views/kafka_shrink.py +++ b/dbm-ui/backend/flow/views/kafka_shrink.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/flow/views/migrate_views/es_fake_apply.py b/dbm-ui/backend/flow/views/migrate_views/es_fake_apply.py index 6ba9b37255..89b2be2f2c 100644 --- a/dbm-ui/backend/flow/views/migrate_views/es_fake_apply.py +++ b/dbm-ui/backend/flow/views/migrate_views/es_fake_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/migrate_views/hdfs_fake_apply.py b/dbm-ui/backend/flow/views/migrate_views/hdfs_fake_apply.py index 571a8c7312..3544b754a6 100644 --- a/dbm-ui/backend/flow/views/migrate_views/hdfs_fake_apply.py +++ b/dbm-ui/backend/flow/views/migrate_views/hdfs_fake_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/migrate_views/influxdb_fake_apply.py b/dbm-ui/backend/flow/views/migrate_views/influxdb_fake_apply.py index dfbe2c0ad4..b5232fa25d 100644 --- a/dbm-ui/backend/flow/views/migrate_views/influxdb_fake_apply.py +++ b/dbm-ui/backend/flow/views/migrate_views/influxdb_fake_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/migrate_views/kafka_fake_apply.py b/dbm-ui/backend/flow/views/migrate_views/kafka_fake_apply.py index 7f8eee0e99..9a5b042ff3 100644 --- a/dbm-ui/backend/flow/views/migrate_views/kafka_fake_apply.py +++ b/dbm-ui/backend/flow/views/migrate_views/kafka_fake_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/migrate_views/riak_migrate.py b/dbm-ui/backend/flow/views/migrate_views/riak_migrate.py index f8d58c831a..7f03aa81e0 100644 --- a/dbm-ui/backend/flow/views/migrate_views/riak_migrate.py +++ b/dbm-ui/backend/flow/views/migrate_views/riak_migrate.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/mysql_add_slave.py b/dbm-ui/backend/flow/views/mysql_add_slave.py index a916023f5b..9b67146ebf 100644 --- a/dbm-ui/backend/flow/views/mysql_add_slave.py +++ b/dbm-ui/backend/flow/views/mysql_add_slave.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_add_slave_remote.py b/dbm-ui/backend/flow/views/mysql_add_slave_remote.py index 0f243c8f92..b91ebc6d9e 100644 --- a/dbm-ui/backend/flow/views/mysql_add_slave_remote.py +++ b/dbm-ui/backend/flow/views/mysql_add_slave_remote.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_edit_config.py b/dbm-ui/backend/flow/views/mysql_edit_config.py index dc6e383122..f4b99bbfea 100644 --- a/dbm-ui/backend/flow/views/mysql_edit_config.py +++ b/dbm-ui/backend/flow/views/mysql_edit_config.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_flashback.py b/dbm-ui/backend/flow/views/mysql_flashback.py index ea253cd76f..3050df1e01 100644 --- a/dbm-ui/backend/flow/views/mysql_flashback.py +++ b/dbm-ui/backend/flow/views/mysql_flashback.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_db_table_backup.py b/dbm-ui/backend/flow/views/mysql_ha_db_table_backup.py index 118d835852..d2e65f9941 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_db_table_backup.py +++ b/dbm-ui/backend/flow/views/mysql_ha_db_table_backup.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_destroy.py b/dbm-ui/backend/flow/views/mysql_ha_destroy.py index c83d530092..a5a52fad9e 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_destroy.py +++ b/dbm-ui/backend/flow/views/mysql_ha_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.permissions import AllowAny from rest_framework.response import Response diff --git a/dbm-ui/backend/flow/views/mysql_ha_full_backup.py b/dbm-ui/backend/flow/views/mysql_ha_full_backup.py index e30f2cbdea..2f91b4a9cf 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_full_backup.py +++ b/dbm-ui/backend/flow/views/mysql_ha_full_backup.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_master_fail_over.py b/dbm-ui/backend/flow/views/mysql_ha_master_fail_over.py index 340bf58e2f..9470e60630 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_master_fail_over.py +++ b/dbm-ui/backend/flow/views/mysql_ha_master_fail_over.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_rename_database.py b/dbm-ui/backend/flow/views/mysql_ha_rename_database.py index c995fb7220..029429cd9c 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_rename_database.py +++ b/dbm-ui/backend/flow/views/mysql_ha_rename_database.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_switch.py b/dbm-ui/backend/flow/views/mysql_ha_switch.py index 7b56c3a2d5..35e9d3f547 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_switch.py +++ b/dbm-ui/backend/flow/views/mysql_ha_switch.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_ha_truncate_data.py b/dbm-ui/backend/flow/views/mysql_ha_truncate_data.py index e23cfad5f9..5f76148ab7 100644 --- a/dbm-ui/backend/flow/views/mysql_ha_truncate_data.py +++ b/dbm-ui/backend/flow/views/mysql_ha_truncate_data.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_migrate_cluster.py b/dbm-ui/backend/flow/views/mysql_migrate_cluster.py index fc0ce938a1..e196605de4 100644 --- a/dbm-ui/backend/flow/views/mysql_migrate_cluster.py +++ b/dbm-ui/backend/flow/views/mysql_migrate_cluster.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py b/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py index 107b797bb4..bc428a0f27 100644 --- a/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py +++ b/dbm-ui/backend/flow/views/mysql_migrate_cluster_remote.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_proxy_add.py b/dbm-ui/backend/flow/views/mysql_proxy_add.py index 181580223a..a43ceccc0c 100644 --- a/dbm-ui/backend/flow/views/mysql_proxy_add.py +++ b/dbm-ui/backend/flow/views/mysql_proxy_add.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_proxy_reduce.py b/dbm-ui/backend/flow/views/mysql_proxy_reduce.py index daf5991c72..67ef046173 100644 --- a/dbm-ui/backend/flow/views/mysql_proxy_reduce.py +++ b/dbm-ui/backend/flow/views/mysql_proxy_reduce.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_proxy_switch.py b/dbm-ui/backend/flow/views/mysql_proxy_switch.py index 863425d387..a98ea643e1 100644 --- a/dbm-ui/backend/flow/views/mysql_proxy_switch.py +++ b/dbm-ui/backend/flow/views/mysql_proxy_switch.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_proxy_upgrade.py b/dbm-ui/backend/flow/views/mysql_proxy_upgrade.py index 78af333a7a..418fbe8ca3 100644 --- a/dbm-ui/backend/flow/views/mysql_proxy_upgrade.py +++ b/dbm-ui/backend/flow/views/mysql_proxy_upgrade.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_pt_table_sync.py b/dbm-ui/backend/flow/views/mysql_pt_table_sync.py index d695d348af..19e2554ac3 100644 --- a/dbm-ui/backend/flow/views/mysql_pt_table_sync.py +++ b/dbm-ui/backend/flow/views/mysql_pt_table_sync.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_restore_local_remote.py b/dbm-ui/backend/flow/views/mysql_restore_local_remote.py index 7ef70cae54..8bc6b9906f 100644 --- a/dbm-ui/backend/flow/views/mysql_restore_local_remote.py +++ b/dbm-ui/backend/flow/views/mysql_restore_local_remote.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_restore_local_slave.py b/dbm-ui/backend/flow/views/mysql_restore_local_slave.py index c92ea5b20c..a184360f52 100644 --- a/dbm-ui/backend/flow/views/mysql_restore_local_slave.py +++ b/dbm-ui/backend/flow/views/mysql_restore_local_slave.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_restore_slave.py b/dbm-ui/backend/flow/views/mysql_restore_slave.py index 9a2f17e684..f2a025bfd9 100644 --- a/dbm-ui/backend/flow/views/mysql_restore_slave.py +++ b/dbm-ui/backend/flow/views/mysql_restore_slave.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py b/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py index e21d8e6c19..f9599bb3a8 100644 --- a/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py +++ b/dbm-ui/backend/flow/views/mysql_restore_slave_remote.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_rollback_data.py b/dbm-ui/backend/flow/views/mysql_rollback_data.py index ad603600b7..7a028b03cd 100644 --- a/dbm-ui/backend/flow/views/mysql_rollback_data.py +++ b/dbm-ui/backend/flow/views/mysql_rollback_data.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_single_apply.py b/dbm-ui/backend/flow/views/mysql_single_apply.py index 09fc6ea945..7fd5372c62 100644 --- a/dbm-ui/backend/flow/views/mysql_single_apply.py +++ b/dbm-ui/backend/flow/views/mysql_single_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_single_destroy.py b/dbm-ui/backend/flow/views/mysql_single_destroy.py index fa00de36c0..fdc5ecbe74 100644 --- a/dbm-ui/backend/flow/views/mysql_single_destroy.py +++ b/dbm-ui/backend/flow/views/mysql_single_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_single_rename_database.py b/dbm-ui/backend/flow/views/mysql_single_rename_database.py index 682df76edb..cda8d42434 100644 --- a/dbm-ui/backend/flow/views/mysql_single_rename_database.py +++ b/dbm-ui/backend/flow/views/mysql_single_rename_database.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/mysql_single_truncate_data.py b/dbm-ui/backend/flow/views/mysql_single_truncate_data.py index 44d6f9bdf5..1dffae3716 100644 --- a/dbm-ui/backend/flow/views/mysql_single_truncate_data.py +++ b/dbm-ui/backend/flow/views/mysql_single_truncate_data.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/flow/views/pulsar_destroy.py b/dbm-ui/backend/flow/views/pulsar_destroy.py index 9c57df79d6..7e60d7fb00 100644 --- a/dbm-ui/backend/flow/views/pulsar_destroy.py +++ b/dbm-ui/backend/flow/views/pulsar_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/flow/views/pulsar_disable.py b/dbm-ui/backend/flow/views/pulsar_disable.py index 8640a030d6..c0fb2fc653 100644 --- a/dbm-ui/backend/flow/views/pulsar_disable.py +++ b/dbm-ui/backend/flow/views/pulsar_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/flow/views/pulsar_enable.py b/dbm-ui/backend/flow/views/pulsar_enable.py index 501333a89c..f1298e4c7e 100644 --- a/dbm-ui/backend/flow/views/pulsar_enable.py +++ b/dbm-ui/backend/flow/views/pulsar_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/flow/views/pulsar_reboot.py b/dbm-ui/backend/flow/views/pulsar_reboot.py index 94c9388ff0..999acba890 100644 --- a/dbm-ui/backend/flow/views/pulsar_reboot.py +++ b/dbm-ui/backend/flow/views/pulsar_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/flow/views/pulsar_replace.py b/dbm-ui/backend/flow/views/pulsar_replace.py index eebc4cb20f..44253cc6dd 100644 --- a/dbm-ui/backend/flow/views/pulsar_replace.py +++ b/dbm-ui/backend/flow/views/pulsar_replace.py @@ -9,7 +9,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/flow/views/pulsar_shrink.py b/dbm-ui/backend/flow/views/pulsar_shrink.py index 2679508eaa..7eedf378be 100644 --- a/dbm-ui/backend/flow/views/pulsar_shrink.py +++ b/dbm-ui/backend/flow/views/pulsar_shrink.py @@ -9,7 +9,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.permissions import AllowAny from rest_framework.response import Response from rest_framework.views import APIView diff --git a/dbm-ui/backend/flow/views/spider_cluster_database_table_backup.py b/dbm-ui/backend/flow/views/spider_cluster_database_table_backup.py index 3441cab0dd..57039cae79 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_database_table_backup.py +++ b/dbm-ui/backend/flow/views/spider_cluster_database_table_backup.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/spider_cluster_destroy.py b/dbm-ui/backend/flow/views/spider_cluster_destroy.py index 25a7b5b2a8..348fd97152 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_destroy.py +++ b/dbm-ui/backend/flow/views/spider_cluster_destroy.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.permissions import AllowAny from rest_framework.response import Response @@ -30,7 +30,7 @@ class DisableSpiderSceneApiView(FlowTestView): # permission_classes = [AllowAny] @staticmethod def post(request): - # from django.utils.translation import ugettext as _ 主要用于国际化中的翻译 + # from django.utils.translation import gettext as _ 主要用于国际化中的翻译 logger.info(_("开始禁用spider集群场景")) root_id = generate_root_id() @@ -49,7 +49,7 @@ class EnableSpiderSceneApiView(FlowTestView): @staticmethod def post(request): - # from django.utils.translation import ugettext as _ 主要用于国际化中的翻译 + # from django.utils.translation import gettext as _ 主要用于国际化中的翻译 logger.info(_("开始启用spider集群场景")) root_id = generate_root_id() diff --git a/dbm-ui/backend/flow/views/spider_cluster_flashback.py b/dbm-ui/backend/flow/views/spider_cluster_flashback.py index 4700330bef..98fb2f3225 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_flashback.py +++ b/dbm-ui/backend/flow/views/spider_cluster_flashback.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/spider_cluster_full_backup.py b/dbm-ui/backend/flow/views/spider_cluster_full_backup.py index 2e7e766687..e0858fd26c 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_full_backup.py +++ b/dbm-ui/backend/flow/views/spider_cluster_full_backup.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/spider_cluster_rename_database.py b/dbm-ui/backend/flow/views/spider_cluster_rename_database.py index 07ee09d4de..185b091170 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_rename_database.py +++ b/dbm-ui/backend/flow/views/spider_cluster_rename_database.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/spider_cluster_standardize.py b/dbm-ui/backend/flow/views/spider_cluster_standardize.py index 51d9335bfe..fa20df149a 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_standardize.py +++ b/dbm-ui/backend/flow/views/spider_cluster_standardize.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/spider_cluster_truncate_database.py b/dbm-ui/backend/flow/views/spider_cluster_truncate_database.py index d5db62e69f..46a6d60861 100644 --- a/dbm-ui/backend/flow/views/spider_cluster_truncate_database.py +++ b/dbm-ui/backend/flow/views/spider_cluster_truncate_database.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/flow/views/tendb_ha_standardize.py b/dbm-ui/backend/flow/views/tendb_ha_standardize.py index 655a672b65..4aab78984b 100644 --- a/dbm-ui/backend/flow/views/tendb_ha_standardize.py +++ b/dbm-ui/backend/flow/views/tendb_ha_standardize.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework.response import Response from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/iam_app/dataclass/__init__.py b/dbm-ui/backend/iam_app/dataclass/__init__.py index bc7742427a..57bacd2d86 100644 --- a/dbm-ui/backend/iam_app/dataclass/__init__.py +++ b/dbm-ui/backend/iam_app/dataclass/__init__.py @@ -12,7 +12,7 @@ from collections import defaultdict from typing import Any, Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from ...env import BK_IAM_SYSTEM_ID from .actions import _all_actions diff --git a/dbm-ui/backend/iam_app/dataclass/actions.py b/dbm-ui/backend/iam_app/dataclass/actions.py index c6bc9c5086..0bb781c41f 100644 --- a/dbm-ui/backend/iam_app/dataclass/actions.py +++ b/dbm-ui/backend/iam_app/dataclass/actions.py @@ -12,7 +12,7 @@ from dataclasses import asdict, dataclass from typing import Dict, List, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from iam import Action from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/iam_app/dataclass/resources.py b/dbm-ui/backend/iam_app/dataclass/resources.py index b24a115030..c690d43e5b 100644 --- a/dbm-ui/backend/iam_app/dataclass/resources.py +++ b/dbm-ui/backend/iam_app/dataclass/resources.py @@ -13,7 +13,7 @@ from typing import Dict, Tuple, Union from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from iam import Resource from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/iam_app/exceptions.py b/dbm-ui/backend/iam_app/exceptions.py index e217cfc517..a072d3d5f5 100644 --- a/dbm-ui/backend/iam_app/exceptions.py +++ b/dbm-ui/backend/iam_app/exceptions.py @@ -9,8 +9,8 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ -from django.utils.translation import ugettext_lazy as _lazy +from django.utils.translation import gettext as _ +from django.utils.translation import gettext_lazy as _lazy from backend import env from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/iam_app/handlers/drf_perm/monitor.py b/dbm-ui/backend/iam_app/handlers/drf_perm/monitor.py index 78ead8eedf..54230e2885 100644 --- a/dbm-ui/backend/iam_app/handlers/drf_perm/monitor.py +++ b/dbm-ui/backend/iam_app/handlers/drf_perm/monitor.py @@ -11,7 +11,7 @@ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_monitor.models import MonitorPolicy, NoticeGroup from backend.iam_app.dataclass.actions import ActionEnum, ActionMeta diff --git a/dbm-ui/backend/iam_app/handlers/drf_perm/openarea.py b/dbm-ui/backend/iam_app/handlers/drf_perm/openarea.py index afdb21528f..db12e7897a 100644 --- a/dbm-ui/backend/iam_app/handlers/drf_perm/openarea.py +++ b/dbm-ui/backend/iam_app/handlers/drf_perm/openarea.py @@ -11,7 +11,7 @@ from typing import List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterType from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig diff --git a/dbm-ui/backend/iam_app/handlers/drf_perm/proxypass.py b/dbm-ui/backend/iam_app/handlers/drf_perm/proxypass.py index 12c8464d43..8b626bf374 100644 --- a/dbm-ui/backend/iam_app/handlers/drf_perm/proxypass.py +++ b/dbm-ui/backend/iam_app/handlers/drf_perm/proxypass.py @@ -10,7 +10,7 @@ """ import binascii -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import permissions from rest_framework.exceptions import PermissionDenied diff --git a/dbm-ui/backend/iam_app/handlers/permission.py b/dbm-ui/backend/iam_app/handlers/permission.py index aff03bc723..503f6ee1b7 100644 --- a/dbm-ui/backend/iam_app/handlers/permission.py +++ b/dbm-ui/backend/iam_app/handlers/permission.py @@ -16,7 +16,7 @@ from blueapps.account.models import User from django.conf import settings -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from iam import IAM, DummyIAM, MultiActionRequest, ObjectSet, Request, Resource, Subject, make_expression from iam.apply.models import ( ActionWithoutResources, diff --git a/dbm-ui/backend/iam_app/serializers.py b/dbm-ui/backend/iam_app/serializers.py index 30850d0198..00a0145063 100644 --- a/dbm-ui/backend/iam_app/serializers.py +++ b/dbm-ui/backend/iam_app/serializers.py @@ -10,7 +10,7 @@ """ import copy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.iam_app import mock_data diff --git a/dbm-ui/backend/iam_app/views/cluster_provider.py b/dbm-ui/backend/iam_app/views/cluster_provider.py index 48b91693b7..1d265b8a24 100644 --- a/dbm-ui/backend/iam_app/views/cluster_provider.py +++ b/dbm-ui/backend/iam_app/views/cluster_provider.py @@ -13,7 +13,7 @@ from typing import Dict, List from django.db import models -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from iam.resource.provider import ListResult from iam.resource.utils import Page diff --git a/dbm-ui/backend/iam_app/views/views.py b/dbm-ui/backend/iam_app/views/views.py index ddad798d08..11ea2ec40e 100644 --- a/dbm-ui/backend/iam_app/views/views.py +++ b/dbm-ui/backend/iam_app/views/views.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import status from rest_framework.decorators import action from rest_framework.response import Response diff --git a/dbm-ui/backend/tests/db_meta/api/cluster/base/__init__.py b/dbm-ui/backend/tests/db_meta/api/cluster/base/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/tests/db_meta/api/cluster/base/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/tests/db_meta/api/cluster/base/test_handler.py b/dbm-ui/backend/tests/db_meta/api/cluster/base/test_handler.py new file mode 100644 index 0000000000..05b5f240f1 --- /dev/null +++ b/dbm-ui/backend/tests/db_meta/api/cluster/base/test_handler.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from unittest.mock import patch + +import pytest +from django.conf import settings + +from backend.db_meta.api.cluster.base.handler import ClusterHandler +from backend.db_meta.enums import ClusterEntryType, ClusterType +from backend.db_meta.models import Cluster, ClusterEntry +from backend.tests.mock_data.components import cc +from backend.tests.mock_data.components.dbconfig import DBConfigApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock +from backend.tests.mock_data.constant import BK_BIZ_ID + +pytestmark = pytest.mark.django_db + + +class TestHandler: + @patch("backend.db_meta.api.cluster.base.handler.DBConfigApi", DBConfigApiMock) + @patch("backend.db_meta.api.cluster.base.handler.DBPrivManagerApi", DBPrivManagerApiMock) + def test_import_meta_mysql_on_k8s(self): + immute_domain = "localhost" + ClusterHandler.import_meta( + { + "cluster_info": { + "name": "cluster-name", + "alias": "", + "bk_biz_id": BK_BIZ_ID, + "cluster_type": ClusterType.MySQLOnK8S, + "immute_domain": immute_domain, + "major_version": "MySQL-5.7", + }, + "cluster_entries": [ + { + "entry": immute_domain, + "cluster_entry_type": ClusterEntryType.K8SService.value, + "access_port": 3306, + } + ], + "storage_instances": [], + "proxy_instances": [], + "db_configs": [ + { + "conf_file": "", + "conf_type": "", + "namespace": "", + "config_map": {"conf_name": "", "conf_value": ""}, + } + ], + "account": { + "instances": [{"domain": immute_domain}, {"ip": cc.NORMAL_IP2}], + "username": settings.DATABASES["default"]["USER"], + "password": settings.DATABASES["default"]["PASSWORD"], + "component": "mysql", + }, + } + ) + assert Cluster.objects.filter(cluster_type=ClusterType.MySQLOnK8S, immute_domain=immute_domain).exists() + assert ClusterEntry.objects.filter(entry=immute_domain).exists() diff --git a/dbm-ui/backend/tests/db_services/mysql/permission/test_account_handler.py b/dbm-ui/backend/tests/db_services/mysql/permission/test_account_handler.py index 5b1443c925..7416318241 100644 --- a/dbm-ui/backend/tests/db_services/mysql/permission/test_account_handler.py +++ b/dbm-ui/backend/tests/db_services/mysql/permission/test_account_handler.py @@ -21,7 +21,7 @@ from backend.db_services.dbpermission.constants import AccountType from backend.db_services.dbpermission.db_account.dataclass import AccountMeta, AccountRuleMeta from backend.db_services.mysql.permission.db_account.handlers import MySQLAccountHandler -from backend.tests.mock_data.components.mysql_priv_manager import DBPrivManagerApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock from backend.tests.mock_data.db_services.mysql.permission.account import ( ACCOUNT, ACCOUNT_RULE, diff --git a/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py b/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py index 8fc56de3c8..91c5a68745 100644 --- a/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py +++ b/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py @@ -21,7 +21,7 @@ from backend.db_services.mysql.permission.authorize.handlers import MySQLAuthorizeHandler from backend.db_services.mysql.permission.constants import AUTHORIZE_EXCEL_HEADER from backend.tests.mock_data import constant -from backend.tests.mock_data.components.mysql_priv_manager import DBPrivManagerApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock from backend.tests.mock_data.db_services.mysql.permission.authorize import AUTHORIZE_DATA, EXCEL_DATA_DICT__LIST from backend.utils.excel import ExcelHandler diff --git a/dbm-ui/backend/tests/db_services/mysql/permission/test_clone_handler.py b/dbm-ui/backend/tests/db_services/mysql/permission/test_clone_handler.py index f24a6b4ca5..041717c270 100644 --- a/dbm-ui/backend/tests/db_services/mysql/permission/test_clone_handler.py +++ b/dbm-ui/backend/tests/db_services/mysql/permission/test_clone_handler.py @@ -21,7 +21,7 @@ from backend.db_services.mysql.permission.clone.handlers import CloneHandler from backend.db_services.mysql.permission.constants import CLONE_CLIENT_EXCEL_HEADER from backend.tests.mock_data import constant -from backend.tests.mock_data.components.mysql_priv_manager import DBPrivManagerApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock from backend.tests.mock_data.db_services.mysql.permission.clone import ( CLONE_CLIENT_LIST_DATA, EXCEL_CLONE_CLIENT_LIST_DATA, diff --git a/dbm-ui/backend/tests/db_services/mysql/remote_service/test_handlers.py b/dbm-ui/backend/tests/db_services/mysql/remote_service/test_handlers.py index 450cd41672..9e16ea90fa 100644 --- a/dbm-ui/backend/tests/db_services/mysql/remote_service/test_handlers.py +++ b/dbm-ui/backend/tests/db_services/mysql/remote_service/test_handlers.py @@ -24,7 +24,4 @@ def test_dbsingle_show_databases(self, bk_biz_id, dbsingle_cluster, dbha_cluster cluster_ids=[dbsingle_cluster.id, dbha_cluster.id] ) for result in results: - if result["cluster_id"] == dbsingle_cluster.id: - assert len(result["databases"]) > 0 - if result["cluster_id"] == dbha_cluster.id: - assert len(result["databases"]) == 0 + assert len(result["databases"]) == 2 diff --git a/dbm-ui/backend/tests/flow/components/collections/mysql/test_exec_actuator_script.py b/dbm-ui/backend/tests/flow/components/collections/mysql/test_exec_actuator_script.py index b0618a73e8..2f7c97a770 100644 --- a/dbm-ui/backend/tests/flow/components/collections/mysql/test_exec_actuator_script.py +++ b/dbm-ui/backend/tests/flow/components/collections/mysql/test_exec_actuator_script.py @@ -26,8 +26,8 @@ from backend.tests.flow.components.collections.mysql.utils import MySQLSingleApplyComponentTest from backend.tests.mock_data.components import cc from backend.tests.mock_data.components.dbconfig import DBConfigApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock from backend.tests.mock_data.components.job import JOB_INSTANCE_ID, STEP_INSTANCE_ID -from backend.tests.mock_data.components.mysql_priv_manager import DBPrivManagerApiMock logger = logging.getLogger("test") pytestmark = pytest.mark.django_db diff --git a/dbm-ui/backend/tests/flow/components/collections/mysql/utils.py b/dbm-ui/backend/tests/flow/components/collections/mysql/utils.py index 0c56e8c5c4..f80a2bd718 100644 --- a/dbm-ui/backend/tests/flow/components/collections/mysql/utils.py +++ b/dbm-ui/backend/tests/flow/components/collections/mysql/utils.py @@ -27,9 +27,9 @@ from backend.tests.flow.components.collections.base import BaseComponentTest from backend.tests.mock_data.components.cc import CCApiMock from backend.tests.mock_data.components.dbconfig import DBConfigApiMock +from backend.tests.mock_data.components.dbpriv_manager import DBPrivManagerApiMock from backend.tests.mock_data.components.dns import DnsApiMock from backend.tests.mock_data.components.job import JobApiMock -from backend.tests.mock_data.components.mysql_priv_manager import DBPrivManagerApiMock from backend.tests.mock_data.flow.components.collections.mysql import MYSQL_SINGLE_APPLY_GLOBAL_DATA from backend.ticket.constants import TicketType from backend.ticket.models import Ticket @@ -96,7 +96,7 @@ def setUpClass(cls) -> Union[Any, NoReturn]: def to_mock_class_list(self) -> List: """需要mock的组件列表""" - mock_class_list = [DBPrivManagerApiMock, DBConfigApiMock, JobApiMock, DnsApiMock, CCApiMock()] + mock_class_list = [DBPrivManagerApiMock, DBConfigApiMock, JobApiMock, DnsApiMock, CCApiMock] return mock_class_list def to_mock_path_list(self) -> List[str]: diff --git a/dbm-ui/backend/tests/mock_data/components/cc.py b/dbm-ui/backend/tests/mock_data/components/cc.py index f594afa8c0..d6abdaff96 100644 --- a/dbm-ui/backend/tests/mock_data/components/cc.py +++ b/dbm-ui/backend/tests/mock_data/components/cc.py @@ -10,8 +10,8 @@ """ import copy -from backend.components import CCApi from backend.tests.mock_data import constant +from backend.tests.mock_data.utils import raw_response MOCK_SEARCH_BUSINESS_RETURN = {"info": [{"bk_biz_id": constant.BK_BIZ_ID, "bk_biz_name": "蓝鲸"}], "count": 1} MOCK_SEARCH_SET_RETURN = {"info": [{"bk_set_id": constant.BK_SET_ID, "bk_set_name": "mock集群"}], "count": 1} @@ -148,7 +148,7 @@ ] -class CCApiMock(CCApi): +class CCApiMock: """ cc的mock接口 """ @@ -183,6 +183,11 @@ def __init__( ) self.search_object_attribute_return = search_object_attribute_return or self.search_object_attribute_return + class ErrorCode: + HOST_NOT_BELONG_BIZ = 1113002 + HOST_NOT_BELONG_MODULE = 1110056 + CUSTOM_FIELD_ALREADY_EXISTS = 1101107 + def search_business(self, *args, **kwargs): return self.search_business_return @@ -235,6 +240,7 @@ def transfer_host_module(*args, **kwargs): return {} @staticmethod + @raw_response def create_biz_custom_field(*args, **kwargs): return {} diff --git a/dbm-ui/backend/tests/mock_data/components/db_remote_service.py b/dbm-ui/backend/tests/mock_data/components/db_remote_service.py index 2f11fb841f..fa83739c43 100644 --- a/dbm-ui/backend/tests/mock_data/components/db_remote_service.py +++ b/dbm-ui/backend/tests/mock_data/components/db_remote_service.py @@ -32,14 +32,4 @@ def rpc(cls, *args, **kwargs): "error_msg": "", } ] - if len(addresses) > 1: - # 添加一个带错误的返回 - err_return_address = addresses[1] - results.append( - { - "address": err_return_address, - "cmd_results": None, - "error_msg": f"connect to {err_return_address} failed: dial tcp {err_return_address}: i/o timeout", - } - ) return results diff --git a/dbm-ui/backend/tests/mock_data/components/dbconfig.py b/dbm-ui/backend/tests/mock_data/components/dbconfig.py index 36aa116d4e..40b3c03328 100644 --- a/dbm-ui/backend/tests/mock_data/components/dbconfig.py +++ b/dbm-ui/backend/tests/mock_data/components/dbconfig.py @@ -177,3 +177,7 @@ def version_detail(cls, *args, **kwargs): def get_instance_config(cls, *args, **kwargs): instance_config_data = cls.query_conf_item(*args, **kwargs) return instance_config_data + + @classmethod + def upsert_conf_item(cls, *args, **kwargs): + return diff --git a/dbm-ui/backend/tests/mock_data/components/mysql_priv_manager.py b/dbm-ui/backend/tests/mock_data/components/dbpriv_manager.py similarity index 98% rename from dbm-ui/backend/tests/mock_data/components/mysql_priv_manager.py rename to dbm-ui/backend/tests/mock_data/components/dbpriv_manager.py index 6f255bb615..84e493f9e9 100644 --- a/dbm-ui/backend/tests/mock_data/components/mysql_priv_manager.py +++ b/dbm-ui/backend/tests/mock_data/components/dbpriv_manager.py @@ -92,7 +92,7 @@ def clone_client(cls, *args, **kwargs): @classmethod @raw_response - def modify_user_password(cls, *args, **kwargs): + def modify_password(cls, *args, **kwargs): return True @classmethod diff --git a/dbm-ui/backend/tests/mock_data/flow/__init__.py b/dbm-ui/backend/tests/mock_data/flow/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/tests/mock_data/flow/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/tests/mock_data/flow/components/__init__.py b/dbm-ui/backend/tests/mock_data/flow/components/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/tests/mock_data/flow/components/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/tests/mock_data/flow/components/collections/__init__.py b/dbm-ui/backend/tests/mock_data/flow/components/collections/__init__.py new file mode 100644 index 0000000000..aa5085c628 --- /dev/null +++ b/dbm-ui/backend/tests/mock_data/flow/components/collections/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" diff --git a/dbm-ui/backend/tests/mock_data/utils.py b/dbm-ui/backend/tests/mock_data/utils.py index fb9bff96f9..1c54a208fe 100644 --- a/dbm-ui/backend/tests/mock_data/utils.py +++ b/dbm-ui/backend/tests/mock_data/utils.py @@ -42,7 +42,7 @@ def raw_response(wrapped, instance, args, kwargs): """根据raw参数来决定是否返回原始的response""" data = wrapped(*args, **kwargs) - raw_resp = {"code": 0, "message": "ok", "data": data} + raw_resp = {"code": 0, "message": "ok", "data": data, "result": True} if kwargs.get("raw", False): return raw_resp diff --git a/dbm-ui/backend/ticket/builders/__init__.py b/dbm-ui/backend/ticket/builders/__init__.py index 96ee19ea35..ca2f223328 100644 --- a/dbm-ui/backend/ticket/builders/__init__.py +++ b/dbm-ui/backend/ticket/builders/__init__.py @@ -15,7 +15,7 @@ import os from typing import Callable, Dict -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend import env diff --git a/dbm-ui/backend/ticket/builders/cloud/dbha_add.py b/dbm-ui/backend/ticket/builders/cloud/dbha_add.py index c01ffca3a1..41fd88a016 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dbha_add.py +++ b/dbm-ui/backend/ticket/builders/cloud/dbha_add.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.flow.consts import CloudDBHATypeEnum diff --git a/dbm-ui/backend/ticket/builders/cloud/dbha_reduce.py b/dbm-ui/backend/ticket/builders/cloud/dbha_reduce.py index e83a81153e..db6a142569 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dbha_reduce.py +++ b/dbm-ui/backend/ticket/builders/cloud/dbha_reduce.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/dbha_reload.py b/dbm-ui/backend/ticket/builders/cloud/dbha_reload.py index 315e870dd7..048ff572ee 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dbha_reload.py +++ b/dbm-ui/backend/ticket/builders/cloud/dbha_reload.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.flow.consts import CloudDBHATypeEnum diff --git a/dbm-ui/backend/ticket/builders/cloud/dbha_replace.py b/dbm-ui/backend/ticket/builders/cloud/dbha_replace.py index 26deb87ade..5541d5d6f1 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dbha_replace.py +++ b/dbm-ui/backend/ticket/builders/cloud/dbha_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.flow.consts import CloudDBHATypeEnum diff --git a/dbm-ui/backend/ticket/builders/cloud/dns_add.py b/dbm-ui/backend/ticket/builders/cloud/dns_add.py index 4575e9499c..81e34ddb87 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dns_add.py +++ b/dbm-ui/backend/ticket/builders/cloud/dns_add.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/dns_reduce.py b/dbm-ui/backend/ticket/builders/cloud/dns_reduce.py index 4525323d59..dfb7f58665 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dns_reduce.py +++ b/dbm-ui/backend/ticket/builders/cloud/dns_reduce.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/dns_reload.py b/dbm-ui/backend/ticket/builders/cloud/dns_reload.py index 4d5b42af6c..9af28c21f6 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dns_reload.py +++ b/dbm-ui/backend/ticket/builders/cloud/dns_reload.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/dns_replace.py b/dbm-ui/backend/ticket/builders/cloud/dns_replace.py index bfed75ee72..c25609c0ac 100644 --- a/dbm-ui/backend/ticket/builders/cloud/dns_replace.py +++ b/dbm-ui/backend/ticket/builders/cloud/dns_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/drs_add.py b/dbm-ui/backend/ticket/builders/cloud/drs_add.py index fdc4874673..0d4c56c304 100644 --- a/dbm-ui/backend/ticket/builders/cloud/drs_add.py +++ b/dbm-ui/backend/ticket/builders/cloud/drs_add.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/drs_reduce.py b/dbm-ui/backend/ticket/builders/cloud/drs_reduce.py index 1779e2c300..1cacd0b175 100644 --- a/dbm-ui/backend/ticket/builders/cloud/drs_reduce.py +++ b/dbm-ui/backend/ticket/builders/cloud/drs_reduce.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/drs_reload.py b/dbm-ui/backend/ticket/builders/cloud/drs_reload.py index 8484c81faf..b01247627d 100644 --- a/dbm-ui/backend/ticket/builders/cloud/drs_reload.py +++ b/dbm-ui/backend/ticket/builders/cloud/drs_reload.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/drs_replace.py b/dbm-ui/backend/ticket/builders/cloud/drs_replace.py index dfa3fa01ea..4113d5a396 100644 --- a/dbm-ui/backend/ticket/builders/cloud/drs_replace.py +++ b/dbm-ui/backend/ticket/builders/cloud/drs_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/nginx_reload.py b/dbm-ui/backend/ticket/builders/cloud/nginx_reload.py index a99fc4205c..6a40cf8ef6 100644 --- a/dbm-ui/backend/ticket/builders/cloud/nginx_reload.py +++ b/dbm-ui/backend/ticket/builders/cloud/nginx_reload.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.models import DBExtension diff --git a/dbm-ui/backend/ticket/builders/cloud/nginx_replace.py b/dbm-ui/backend/ticket/builders/cloud/nginx_replace.py index 95fe226951..3e70204365 100644 --- a/dbm-ui/backend/ticket/builders/cloud/nginx_replace.py +++ b/dbm-ui/backend/ticket/builders/cloud/nginx_replace.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/redis_dts_add.py b/dbm-ui/backend/ticket/builders/cloud/redis_dts_add.py index 92e30c0f2f..65557ecd04 100644 --- a/dbm-ui/backend/ticket/builders/cloud/redis_dts_add.py +++ b/dbm-ui/backend/ticket/builders/cloud/redis_dts_add.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/redis_dts_reduce.py b/dbm-ui/backend/ticket/builders/cloud/redis_dts_reduce.py index 2fdace590d..97dcc51bc5 100644 --- a/dbm-ui/backend/ticket/builders/cloud/redis_dts_reduce.py +++ b/dbm-ui/backend/ticket/builders/cloud/redis_dts_reduce.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_proxy.constants import ExtensionType diff --git a/dbm-ui/backend/ticket/builders/cloud/service_apply.py b/dbm-ui/backend/ticket/builders/cloud/service_apply.py index 2413784e50..01711dd06a 100644 --- a/dbm-ui/backend/ticket/builders/cloud/service_apply.py +++ b/dbm-ui/backend/ticket/builders/cloud/service_apply.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.flow.engine.controller.cloud import CloudServiceController diff --git a/dbm-ui/backend/ticket/builders/common/bigdata.py b/dbm-ui/backend/ticket/builders/common/bigdata.py index da29b5e8f3..a80ebca378 100644 --- a/dbm-ui/backend/ticket/builders/common/bigdata.py +++ b/dbm-ui/backend/ticket/builders/common/bigdata.py @@ -11,7 +11,7 @@ import itertools from typing import Dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from rest_framework.serializers import ValidationError diff --git a/dbm-ui/backend/ticket/builders/es/es_apply.py b/dbm-ui/backend/ticket/builders/es/es_apply.py index 80199dc14d..0cf496b9e2 100644 --- a/dbm-ui/backend/ticket/builders/es/es_apply.py +++ b/dbm-ui/backend/ticket/builders/es/es_apply.py @@ -11,7 +11,7 @@ import logging from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/es/es_destroy.py b/dbm-ui/backend/ticket/builders/es/es_destroy.py index c87b0ca6ef..d1b28fdab1 100644 --- a/dbm-ui/backend/ticket/builders/es/es_destroy.py +++ b/dbm-ui/backend/ticket/builders/es/es_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/ticket/builders/es/es_disable.py b/dbm-ui/backend/ticket/builders/es/es_disable.py index 1f6eb2a9c2..498b84f906 100644 --- a/dbm-ui/backend/ticket/builders/es/es_disable.py +++ b/dbm-ui/backend/ticket/builders/es/es_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/ticket/builders/es/es_enable.py b/dbm-ui/backend/ticket/builders/es/es_enable.py index 6cfdf76dfb..2029fad42e 100644 --- a/dbm-ui/backend/ticket/builders/es/es_enable.py +++ b/dbm-ui/backend/ticket/builders/es/es_enable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.es import EsController diff --git a/dbm-ui/backend/ticket/builders/es/es_reboot.py b/dbm-ui/backend/ticket/builders/es/es_reboot.py index 643abb4cdd..200f81d05f 100644 --- a/dbm-ui/backend/ticket/builders/es/es_reboot.py +++ b/dbm-ui/backend/ticket/builders/es/es_reboot.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.es import EsController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/es/es_replace.py b/dbm-ui/backend/ticket/builders/es/es_replace.py index 29842b6d3e..72123479e5 100644 --- a/dbm-ui/backend/ticket/builders/es/es_replace.py +++ b/dbm-ui/backend/ticket/builders/es/es_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.es import EsController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/es/es_scale_up.py b/dbm-ui/backend/ticket/builders/es/es_scale_up.py index 6aaf99f310..6f5b6c3a14 100644 --- a/dbm-ui/backend/ticket/builders/es/es_scale_up.py +++ b/dbm-ui/backend/ticket/builders/es/es_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.dbbase.constants import IpSource diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_apply.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_apply.py index 7bd5d57370..dc0661d259 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_apply.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_apply.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_destroy.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_destroy.py index d6b4cc3567..059aa20edd 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_destroy.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_destroy.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_disable.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_disable.py index ad2742b5fc..e89e8ee307 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_disable.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_disable.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_enable.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_enable.py index 6dcba70531..21e523a6c9 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_enable.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_enable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.hdfs import HdfsController diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_reboot.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_reboot.py index 1da7957c8d..9a4d0e8a28 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_reboot.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_reboot.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.hdfs import HdfsController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_replace.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_replace.py index e042901523..1ac58bfeea 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_replace.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums.instance_role import InstanceRole diff --git a/dbm-ui/backend/ticket/builders/hdfs/hdfs_scale_up.py b/dbm-ui/backend/ticket/builders/hdfs/hdfs_scale_up.py index 0c4d8f7775..c416dbafc6 100644 --- a/dbm-ui/backend/ticket/builders/hdfs/hdfs_scale_up.py +++ b/dbm-ui/backend/ticket/builders/hdfs/hdfs_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.hdfs import HdfsController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_apply.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_apply.py index d69de23571..88de7b2e3d 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_apply.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_apply.py @@ -11,7 +11,7 @@ import logging from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_destroy.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_destroy.py index 1a6fd6808f..5188426be2 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_destroy.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_destroy.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_disable.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_disable.py index ee1f5f1fd6..eef73a05b3 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_disable.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_disable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_enable.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_enable.py index b254ee8643..5e7db2b67a 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_enable.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_enable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_reboot.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_reboot.py index 75d3047f64..8c2b518059 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_reboot.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_reboot.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.influxdb import InfluxdbController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/influxdb/influxdb_replace.py b/dbm-ui/backend/ticket/builders/influxdb/influxdb_replace.py index 4a2b09191a..92d938c00c 100644 --- a/dbm-ui/backend/ticket/builders/influxdb/influxdb_replace.py +++ b/dbm-ui/backend/ticket/builders/influxdb/influxdb_replace.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.flow.engine.controller.influxdb import InfluxdbController diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py b/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py index cf5d894faa..8f0390ea04 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_apply.py @@ -10,7 +10,7 @@ """ from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_destroy.py b/dbm-ui/backend/ticket/builders/kafka/kafka_destroy.py index f597019187..cb42c72151 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_destroy.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_destroy.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_disable.py b/dbm-ui/backend/ticket/builders/kafka/kafka_disable.py index b3cbd57a46..d2d0df4e90 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_disable.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_disable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_enable.py b/dbm-ui/backend/ticket/builders/kafka/kafka_enable.py index 3b28d11995..5cac58eecf 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_enable.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_enable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.kafka import KafkaController diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_reboot.py b/dbm-ui/backend/ticket/builders/kafka/kafka_reboot.py index c97f98310f..8a951f5b40 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_reboot.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_reboot.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.kafka import KafkaController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_replace.py b/dbm-ui/backend/ticket/builders/kafka/kafka_replace.py index 10ceaf3011..ff8ea9467c 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_replace.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_replace.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.kafka import KafkaController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/kafka/kafka_scale_up.py b/dbm-ui/backend/ticket/builders/kafka/kafka_scale_up.py index ca90777399..f772b68b31 100644 --- a/dbm-ui/backend/ticket/builders/kafka/kafka_scale_up.py +++ b/dbm-ui/backend/ticket/builders/kafka/kafka_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.kafka import KafkaController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/mongodb/base.py b/dbm-ui/backend/ticket/builders/mongodb/base.py index 10203aa125..9f56128603 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/base.py +++ b/dbm-ui/backend/ticket/builders/mongodb/base.py @@ -12,7 +12,7 @@ from typing import Dict, List from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum, DBType diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_add_mongos.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_add_mongos.py index 107a8bdb3e..a83dd47fc5 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_add_mongos.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_add_mongos.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, MachineType diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_add_shard_nodes.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_add_shard_nodes.py index b07f3c45c0..e5e9e61e3d 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_add_shard_nodes.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_add_shard_nodes.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_authorize.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_authorize.py index c12056c06e..2c604ae0c2 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_authorize.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_authorize.py @@ -10,7 +10,7 @@ """ from django.core.cache import cache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.dbpermission.db_authorize.serializers import PreCheckAuthorizeRulesSerializer diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_backup.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_backup.py index 6afa3f7536..54a1f30cf9 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_backup.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_backup.py @@ -10,7 +10,7 @@ """ import itertools -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, ClusterTypeMachineTypeDefine diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_clear.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_clear.py index c090afbc9b..4d5f644cbc 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_clear.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_clear.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.consts import MongoDBDropType diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_cutoff.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_cutoff.py index 1654cd02e4..ed18317ff8 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_cutoff.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_cutoff.py @@ -11,7 +11,7 @@ import itertools from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, MachineType diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_destroy.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_destroy.py index d84cd76efe..b799d2ea1d 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_destroy.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_destroy.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterPhase diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_disable.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_disable.py index 8ce58ca6a9..8c13585b3c 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_disable.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_disable.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterPhase diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_enable.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_enable.py index b09b18aef0..2eb7a6421a 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_enable.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_enable.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterPhase diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_full_backup.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_full_backup.py index 241df13c45..f892cb4979 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_full_backup.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_full_backup.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.consts import MongoDBBackupFileTagEnum diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_instance_reload.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_instance_reload.py index e9f30f9927..fed7bd1bb6 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_instance_reload.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_instance_reload.py @@ -12,7 +12,7 @@ from functools import reduce from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import StorageInstance diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_mongos.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_mongos.py index 686b1a2194..5a651a0c4c 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_mongos.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_mongos.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, MachineType diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_shard_nodes.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_shard_nodes.py index 492257783a..dfafb94afd 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_shard_nodes.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_reduce_shard_nodes.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.mongodb import MongoDBController diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_replicaset_apply.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_replicaset_apply.py index 5fc8343cc6..7634e82d27 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_replicaset_apply.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_replicaset_apply.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_restore.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_restore.py index 19c504e8fe..6dfa09cfb9 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_restore.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_restore.py @@ -12,7 +12,7 @@ from typing import Any, Dict, List from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_scale_updown.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_scale_updown.py index f4bfe7490e..f5a30dfef8 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_scale_updown.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_scale_updown.py @@ -11,7 +11,7 @@ from collections import defaultdict from typing import Dict, List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_script_exec.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_script_exec.py index 88a14d611a..0bbc40ae37 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_script_exec.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_script_exec.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.crypto import get_random_string -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.mongodb import MongoDBController diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongo_shard_apply.py b/dbm-ui/backend/ticket/builders/mongodb/mongo_shard_apply.py index bc58973690..535051a51c 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongo_shard_apply.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongo_shard_apply.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/mongodb/mongodb_temporary_destroy.py b/dbm-ui/backend/ticket/builders/mongodb/mongodb_temporary_destroy.py index 77c798fe88..bd96cbe4a4 100644 --- a/dbm-ui/backend/ticket/builders/mongodb/mongodb_temporary_destroy.py +++ b/dbm-ui/backend/ticket/builders/mongodb/mongodb_temporary_destroy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.models import AppCache diff --git a/dbm-ui/backend/ticket/builders/mysql/base.py b/dbm-ui/backend/ticket/builders/mysql/base.py index 47cb2b1800..11d1371c69 100644 --- a/dbm-ui/backend/ticket/builders/mysql/base.py +++ b/dbm-ui/backend/ticket/builders/mysql/base.py @@ -11,7 +11,7 @@ import re from typing import Any, Dict, List, Union -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from rest_framework.serializers import ValidationError diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_authorize_rules.py b/dbm-ui/backend/ticket/builders/mysql/mysql_authorize_rules.py index 66b3b894bd..43004dcbea 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_authorize_rules.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_authorize_rules.py @@ -10,7 +10,7 @@ """ from django.core.cache import cache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend import env diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py b/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py index 0e91e50da6..78922c33b0 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py @@ -13,7 +13,7 @@ from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import InstanceInnerRole diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_clone_rules.py b/dbm-ui/backend/ticket/builders/mysql/mysql_clone_rules.py index 145e06a749..976326f39f 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_clone_rules.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_clone_rules.py @@ -10,7 +10,7 @@ """ from django.core.cache import cache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend import env diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_data_repair.py b/dbm-ui/backend/ticket/builders/mysql/mysql_data_repair.py index 3ab8ee6a33..880c838ba9 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_data_repair.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_data_repair.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py index c79cfe2aa1..af3549ca31 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_apply.py @@ -10,7 +10,7 @@ """ from typing import Dict, List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.components import DBConfigApi diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_backup.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_backup.py index f5042eccf6..6afded2d99 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_backup.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_backup.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py index b351a9b879..36632ccbaa 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_clear.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.consts import TruncateDataTypeEnum diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_destroy.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_destroy.py index 5f1b95e7fe..e22f64674b 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_destroy.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_destroy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.db_meta.enums.extra_process_type import ExtraProcessType diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_disable.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_disable.py index 0c9213caa5..e1dd63ed7b 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_disable.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_disable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_enable.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_enable.py index 64e8eef6f1..fae1e222a1 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_enable.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_enable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py index 9810cb5cef..28b1d02ceb 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_full_backup.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterDBHAStatusFlags, InstanceInnerRole diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py index 8f766d19a2..2a68afa240 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_metadata_import.py @@ -11,7 +11,7 @@ import json import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.components import DBConfigApi diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_rename.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_rename.py index b198106c3a..2de14c99e2 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_rename.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_rename.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_services.mysql.remote_service.handlers import RemoteServiceHandler diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_standardize.py b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_standardize.py index c742505fd7..5642610f1b 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_ha_standardize.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_ha_standardize.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, InstanceInnerRole diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_import_sqlfile.py b/dbm-ui/backend/ticket/builders/mysql/mysql_import_sqlfile.py index dc152c9ace..878c428a76 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_import_sqlfile.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_import_sqlfile.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend import env diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py b/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py index eb0c9a2c2d..487b64807c 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_master_fail_over.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.mysql import MySQLController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py b/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py index 10eafbd657..2cd50616ab 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_single_apply.py @@ -12,7 +12,7 @@ import itertools from typing import Dict, List -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.bk_web.constants import LEN_MIDDLE, SMALLEST_POSITIVE_INTEGER diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_single_destroy.py b/dbm-ui/backend/ticket/builders/mysql/mysql_single_destroy.py index ebbc18dd09..9b91f5730f 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_single_destroy.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_single_destroy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_single_disable.py b/dbm-ui/backend/ticket/builders/mysql/mysql_single_disable.py index dfc8c74aab..f7b923df29 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_single_disable.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_single_disable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_single_enable.py b/dbm-ui/backend/ticket/builders/mysql/mysql_single_enable.py index 8372721d35..78af023059 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_single_enable.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_single_enable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.mysql import MySQLController diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_apply.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_apply.py index aaccd45de4..0878cd1a9f 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_apply.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_apply.py @@ -11,7 +11,7 @@ import logging from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_destroy.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_destroy.py index 4ad2f64a4a..53373c62e2 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_destroy.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_destroy.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_disable.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_disable.py index 4b73bcce66..71c62f88f6 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_disable.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_disable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_enable.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_enable.py index 418afaaa8e..1efaf706f7 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_enable.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_enable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.pulsar import PulsarController diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_reboot.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_reboot.py index 3dcf315b10..bc8bd56ab5 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_reboot.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_reboot.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.pulsar import PulsarController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_replace.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_replace.py index 5787caa0fb..54632521f5 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_replace.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_replace.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.pulsar import PulsarController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_scale_up.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_scale_up.py index 213acd1f02..bc3a14c6c4 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_scale_up.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.pulsar import PulsarController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/pulsar/pulsar_shrink.py b/dbm-ui/backend/ticket/builders/pulsar/pulsar_shrink.py index 64d7596892..f382102ecc 100644 --- a/dbm-ui/backend/ticket/builders/pulsar/pulsar_shrink.py +++ b/dbm-ui/backend/ticket/builders/pulsar/pulsar_shrink.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/ticket/builders/redis/base.py b/dbm-ui/backend/ticket/builders/redis/base.py index 8ce240d756..d29cf2bdba 100644 --- a/dbm-ui/backend/ticket/builders/redis/base.py +++ b/dbm-ui/backend/ticket/builders/redis/base.py @@ -11,7 +11,7 @@ import os import humanize -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_create_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_create_clb.py index b5e4ecf40d..2e8deafaab 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_create_clb.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_create_clb.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_create_polaris.py b/dbm-ui/backend/ticket/builders/redis/plugin_create_polaris.py index 76ebf8d9f0..feda1615c1 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_create_polaris.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_create_polaris.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_delete_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_delete_clb.py index 2da37592a9..cbc23f95f2 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_delete_clb.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_delete_clb.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_delete_polaris.py b/dbm-ui/backend/ticket/builders/redis/plugin_delete_polaris.py index 9ead7fa1a5..5cf9b827bd 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_delete_polaris.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_delete_polaris.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py index f21f9ecf38..ddec92040c 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_dns_bind_clb.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py b/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py index 2f7fd0de04..fdb8847f16 100644 --- a/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py +++ b/dbm-ui/backend/ticket/builders/redis/plugin_dns_unbind_clb.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.name_service import NameServiceController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/redis_backup.py b/dbm-ui/backend/ticket/builders/redis/redis_backup.py index 3d8b220007..ecad1cef89 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_backup.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_backup.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.redis import RedisController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/redis_close.py b/dbm-ui/backend/ticket/builders/redis/redis_close.py index 63e15500ee..4cccb74fd1 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_close.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_close.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.redis import RedisController diff --git a/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py b/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py index ea98f9f0e0..86f609ec22 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_cluster_apply.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.utils.crypto import get_random_string -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/redis/redis_destroy.py b/dbm-ui/backend/ticket/builders/redis/redis_destroy.py index f624b149df..9a9925e37f 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_destroy.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_destroy.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.redis import RedisController diff --git a/dbm-ui/backend/ticket/builders/redis/redis_key_delete.py b/dbm-ui/backend/ticket/builders/redis/redis_key_delete.py index 863631471e..b1dae96361 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_key_delete.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_key_delete.py @@ -11,7 +11,7 @@ import os from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.core.storages.storage import get_storage diff --git a/dbm-ui/backend/ticket/builders/redis/redis_key_extract.py b/dbm-ui/backend/ticket/builders/redis/redis_key_extract.py index 80a32f419b..dd95efd5a6 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_key_extract.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_key_extract.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.redis import RedisController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/redis_open.py b/dbm-ui/backend/ticket/builders/redis/redis_open.py index 17570b2e04..c6ebf7702a 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_open.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_open.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.redis import RedisController diff --git a/dbm-ui/backend/ticket/builders/redis/redis_purge.py b/dbm-ui/backend/ticket/builders/redis/redis_purge.py index c4fc25aaf5..920f715670 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_purge.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_purge.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.redis import RedisController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_add_slave.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_add_slave.py index 51571578fd..2ac12ea2a1 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_add_slave.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_add_slave.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import InstanceRole, InstanceStatus diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_autofix.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_autofix.py index 88702b9913..c9aa9dd607 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_autofix.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_autofix.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_cut_off.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_cut_off.py index 6f8ab31bff..4986c26964 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_cut_off.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_cut_off.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import InstanceRole diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_check_repair.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_check_repair.py index cb5a5728d1..0afd3930aa 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_check_repair.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_check_repair.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.redis.redis_dts.enums import DtsDataRepairMode, ExecuteMode diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_copy.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_copy.py index 6bccb212b6..713e41615f 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_copy.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_data_copy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_datastruct_task_delete.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_datastruct_task_delete.py index 540dd07f67..9b3f02d9e6 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_datastruct_task_delete.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_datastruct_task_delete.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import DestroyedStatus diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_fixpoint_make.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_fixpoint_make.py index 7f35a37c8d..1eca4c380b 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_fixpoint_make.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_fixpoint_make.py @@ -11,7 +11,7 @@ import datetime from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_instance_shutdown.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_instance_shutdown.py index 4e471b4fba..0542b8c8ec 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_instance_shutdown.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_instance_shutdown.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.redis import RedisController diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py index 25ff80d736..7ede78152b 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_master_slave_switch.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_down.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_down.py index 368344fe64..7eb67f6c6c 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_down.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_down.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.redis import RedisController diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py index dc64097720..64128e17f9 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py @@ -10,7 +10,7 @@ """ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.dbbase.constants import IpSource diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py index 59c4a21bf7..b06dedc7d0 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_redis_scale_updown.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_rollback_data_copy.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_rollback_data_copy.py index 8806989660..001f60b38b 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_rollback_data_copy.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_rollback_data_copy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_services.redis.redis_dts.enums import DtsCopyType diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py index 6fa37073d2..2e8093d27b 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_shard_update.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py index 10c2b86d32..d766f0532e 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_type_update.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import AffinityEnum diff --git a/dbm-ui/backend/ticket/builders/riak/riak_apply.py b/dbm-ui/backend/ticket/builders/riak/riak_apply.py index 78b9c70eff..ec5bf20407 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_apply.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_apply.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/riak/riak_destroy.py b/dbm-ui/backend/ticket/builders/riak/riak_destroy.py index cbce5ed70c..f666cf6efb 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_destroy.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_destroy.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/riak/riak_disable.py b/dbm-ui/backend/ticket/builders/riak/riak_disable.py index 22d85deeb7..f0d721aa16 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_disable.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_disable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/riak/riak_enable.py b/dbm-ui/backend/ticket/builders/riak/riak_enable.py index a98cdbba6f..52ca0b108e 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_enable.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_enable.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.enums import ClusterPhase from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/riak/riak_migrate.py b/dbm-ui/backend/ticket/builders/riak/riak_migrate.py index 71491e4e81..bd11f5c39a 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_migrate.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_migrate.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/riak/riak_reboot.py b/dbm-ui/backend/ticket/builders/riak/riak_reboot.py index 82095259c0..56be68f14d 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_reboot.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_reboot.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.enums import MachineType diff --git a/dbm-ui/backend/ticket/builders/riak/riak_scale_up.py b/dbm-ui/backend/ticket/builders/riak/riak_scale_up.py index 3c010d5d63..ffb70c1a1e 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_scale_up.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_scale_up.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.db_meta.models import Cluster from backend.db_services.dbbase.constants import IpSource diff --git a/dbm-ui/backend/ticket/builders/riak/riak_shrink.py b/dbm-ui/backend/ticket/builders/riak/riak_shrink.py index a789c92efc..60e687ff7e 100644 --- a/dbm-ui/backend/ticket/builders/riak/riak_shrink.py +++ b/dbm-ui/backend/ticket/builders/riak/riak_shrink.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/builders/spider/metadata_import.py b/dbm-ui/backend/ticket/builders/spider/metadata_import.py index b8ce4d51d8..d2abdaf7ab 100644 --- a/dbm-ui/backend/ticket/builders/spider/metadata_import.py +++ b/dbm-ui/backend/ticket/builders/spider/metadata_import.py @@ -11,7 +11,7 @@ import json import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.components import DBConfigApi diff --git a/dbm-ui/backend/ticket/builders/spider/mysql_spider_standardize.py b/dbm-ui/backend/ticket/builders/spider/mysql_spider_standardize.py index 88578e81bd..52582a0a40 100644 --- a/dbm-ui/backend/ticket/builders/spider/mysql_spider_standardize.py +++ b/dbm-ui/backend/ticket/builders/spider/mysql_spider_standardize.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType diff --git a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_apply.py b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_apply.py index 8a91ac1895..8e8bd97a29 100644 --- a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_apply.py +++ b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_apply.py @@ -13,7 +13,7 @@ from django.db.models import Q from django.db.transaction import atomic -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums.extra_process_type import ExtraProcessType diff --git a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_disable.py b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_disable.py index 90465801e9..094c33df37 100644 --- a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_disable.py +++ b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_disable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.tbinlogdumper import TBinlogDumperController diff --git a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_enable.py b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_enable.py index 694621a380..20542ecee1 100644 --- a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_enable.py +++ b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_enable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.tbinlogdumper import TBinlogDumperController diff --git a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_reduce_nodes.py b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_reduce_nodes.py index 430860ec15..8ce6bc63d0 100644 --- a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_reduce_nodes.py +++ b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_reduce_nodes.py @@ -14,7 +14,7 @@ from typing import Dict, List from django.db.models import Q -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.models import ExtraProcessInstance diff --git a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_switch.py b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_switch.py index c1d19c1830..56ce369e2e 100644 --- a/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_switch.py +++ b/dbm-ui/backend/ticket/builders/tbinlogdumper/dumper_switch.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.flow.engine.controller.tbinlogdumper import TBinlogDumperController diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/append_deploy_ctl.py b/dbm-ui/backend/ticket/builders/tendbcluster/append_deploy_ctl.py index 48f8746e99..656888345a 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/append_deploy_ctl.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/append_deploy_ctl.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.db_meta.enums import ClusterType, TenDBClusterSpiderRole diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/base.py b/dbm-ui/backend/ticket/builders/tendbcluster/base.py index 98d902a69f..77295d7fa6 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/base.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/base.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db.models import Q -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py index b5c3f0ade3..cd88fc41ee 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_apply.py @@ -10,7 +10,7 @@ """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.components import DBConfigApi diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_authorize_rules.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_authorize_rules.py index 438f17e224..9c79783fb9 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_authorize_rules.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_authorize_rules.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_services.dbpermission.constants import AccountType from backend.db_services.mysql.permission.db_account.handlers import MySQLAccountHandler diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clear.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clear.py index 566a005fcd..b6c35f3622 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clear.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clear.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clone_rules.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clone_rules.py index e5760a14b0..4bcba2f7b1 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clone_rules.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_clone_rules.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.configuration.constants import DBType diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_data_repair.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_data_repair.py index d624ece7be..bf82695eaf 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_data_repair.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_data_repair.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.flow.engine.controller.mysql import MySQLController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_destroy.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_destroy.py index ea72426e3f..582e60b93f 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_destroy.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_destroy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_disable.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_disable.py index d93215f7ba..74f9e7a670 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_disable.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_disable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_enable.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_enable.py index 99c050af12..fece3817ad 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_enable.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_enable.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.db_meta.enums import ClusterPhase from backend.flow.engine.controller.spider import SpiderController diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_import_sqlfile.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_import_sqlfile.py index 31d88a0a24..3336194fbd 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_import_sqlfile.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_import_sqlfile.py @@ -11,7 +11,7 @@ import logging -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.configuration.constants import DBType from backend.db_services.mysql.sql_import.constants import SQLExecuteTicketMode diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_rename.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_rename.py index 234a02476d..de5a19e530 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_rename.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_rename.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py index bc6bcf8e3d..5770f95b93 100644 --- a/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py +++ b/dbm-ui/backend/ticket/builders/tendbcluster/tendb_temporary_destroy.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend.flow.engine.controller.spider import SpiderController from backend.ticket import builders diff --git a/dbm-ui/backend/ticket/constants.py b/dbm-ui/backend/ticket/constants.py index 30eb458e99..3c72be420f 100644 --- a/dbm-ui/backend/ticket/constants.py +++ b/dbm-ui/backend/ticket/constants.py @@ -10,7 +10,7 @@ """ from typing import Any, Optional -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.configuration.constants import DBType from backend.db_meta.exceptions import ClusterExclusiveOperateException diff --git a/dbm-ui/backend/ticket/exceptions.py b/dbm-ui/backend/ticket/exceptions.py index 410fdaf889..1fe4431aaa 100644 --- a/dbm-ui/backend/ticket/exceptions.py +++ b/dbm-ui/backend/ticket/exceptions.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.exceptions import AppBaseException, ErrorCode diff --git a/dbm-ui/backend/ticket/handler.py b/dbm-ui/backend/ticket/handler.py index 4e1e24e796..170c09b957 100644 --- a/dbm-ui/backend/ticket/handler.py +++ b/dbm-ui/backend/ticket/handler.py @@ -10,7 +10,7 @@ """ from typing import Dict, List -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from backend import env from backend.db_meta.models import Cluster diff --git a/dbm-ui/backend/ticket/mock_data.py b/dbm-ui/backend/ticket/mock_data.py index 0291428190..1e3ab9f471 100644 --- a/dbm-ui/backend/ticket/mock_data.py +++ b/dbm-ui/backend/ticket/mock_data.py @@ -8,7 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ CREATE_SINGLE_TICKET_DATA = { "ticket_type": "MYSQL_SINGLE_APPLY", diff --git a/dbm-ui/backend/ticket/models/ticket.py b/dbm-ui/backend/ticket/models/ticket.py index 035e0a0de5..f7a0cf3e96 100644 --- a/dbm-ui/backend/ticket/models/ticket.py +++ b/dbm-ui/backend/ticket/models/ticket.py @@ -15,7 +15,7 @@ from django.db import models, transaction from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.bk_web.constants import LEN_LONG, LEN_MIDDLE, LEN_NORMAL, LEN_SHORT diff --git a/dbm-ui/backend/ticket/models/ticket_result_relation.py b/dbm-ui/backend/ticket/models/ticket_result_relation.py index 9f2e59614b..352319a03b 100644 --- a/dbm-ui/backend/ticket/models/ticket_result_relation.py +++ b/dbm-ui/backend/ticket/models/ticket_result_relation.py @@ -9,7 +9,7 @@ specific language governing permissions and limitations under the License. """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.bk_web.models import AuditedModel diff --git a/dbm-ui/backend/ticket/models/todo.py b/dbm-ui/backend/ticket/models/todo.py index 8c360b55e1..0bd521824f 100644 --- a/dbm-ui/backend/ticket/models/todo.py +++ b/dbm-ui/backend/ticket/models/todo.py @@ -12,7 +12,7 @@ from django.db import models from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.bk_web.constants import LEN_MIDDLE, LEN_SHORT diff --git a/dbm-ui/backend/ticket/serializers.py b/dbm-ui/backend/ticket/serializers.py index 1e88991d9a..00d34aa5a3 100644 --- a/dbm-ui/backend/ticket/serializers.py +++ b/dbm-ui/backend/ticket/serializers.py @@ -11,7 +11,7 @@ from typing import Optional from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from backend.bk_web.constants import LEN_MIDDLE diff --git a/dbm-ui/backend/ticket/tasks/__init__.py b/dbm-ui/backend/ticket/tasks/__init__.py new file mode 100644 index 0000000000..a3e20e3f61 --- /dev/null +++ b/dbm-ui/backend/ticket/tasks/__init__.py @@ -0,0 +1,497 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import importlib +import json +import logging +import os +from typing import Callable, Dict + +from django.utils.translation import gettext as _ +from rest_framework import serializers + +from backend import env +from backend.configuration.constants import SystemSettingsEnum +from backend.configuration.models import DBAdministrator, SystemSettings +from backend.db_meta.models import Cluster +from backend.db_services.dbbase.constants import IpSource +from backend.ticket.constants import FlowRetryType, FlowType +from backend.ticket.models import Flow, Ticket, TicketFlowConfig + +logger = logging.getLogger("root") + + +class CallBackBuilderMixin(object): + """为节点添加前置/后继钩子函数信息""" + + def __init__(self, ticket: Ticket): + self.ticket = ticket + + def pre_callback(self): + pass + + def post_callback(self): + pass + + def add_common_params(self): + self.ticket_data.update( + { + "uid": self.ticket.id, + "ticket_type": self.ticket.ticket_type, + "created_by": self.ticket.creator, + "bk_biz_id": self.ticket.bk_biz_id, + } + ) + + def build_callback_info(self) -> Dict: + return { + "pre_callback_module": self.pre_callback.__module__, + "pre_callback_class": self.pre_callback.__qualname__.split(".")[0], + "post_callback_module": self.post_callback.__module__, + "post_callback_class": self.post_callback.__qualname__.split(".")[0], + } + + def inject_callback_in_params(self, params: Dict = None) -> Dict: + params = params or {} + params.update({"callback_info": self.build_callback_info()}) + return params + + +class FlowParamBuilder(CallBackBuilderMixin): + """ + Flow 参数构建器 + 职责:将单据详情(ticket.details)转化为 Flow 流程运行所需的参数 + """ + + # 配置任务流程控制器:流程启动函数 + controller = None + + def __init__(self, ticket: Ticket): + self.ticket = ticket + self.ticket_data = copy.deepcopy(ticket.details) + + def build_controller_info(self) -> dict: + return { + "func_name": self.controller.__name__, + "class_name": self.controller.__qualname__.split(".")[0], + "module": self.controller.__module__, + } + + def format_ticket_data(self): + """格式化单据数据,由子类实现""" + pass + + def get_params(self) -> dict: + self.add_common_params() + self.format_ticket_data() + + params = { + "ticket_data": copy.deepcopy(self.ticket_data), + "controller_info": self.build_controller_info(), + } + params = super().inject_callback_in_params(params=params) + + if env.ENVIRONMENT == "dev": + logger.info("flow.bamboo.params: \n%s\n", json.dumps(params, indent=2)) + + return params + + +class ItsmParamBuilder(CallBackBuilderMixin): + """ + ITSM 参数构建器 + 职责:将单据详情(ticket.details)转化为 ITSM 单据创建所需的参数 + - 定义单据的审批人,默认取对应 DB 类型的管理员 + - 格式化单据概览,提高单据的可读性 + """ + + def __init__(self, ticket: Ticket): + self.ticket = ticket + self.details = copy.deepcopy(ticket.details) + + def get_approvers(self): + db_type = BuilderFactory.registry[self.ticket.ticket_type].group + approvers = DBAdministrator.get_biz_db_type_admins(self.ticket.bk_biz_id, db_type) + return ",".join(approvers) + + def format(self): + pass + + def get_params(self): + self.format() + # clusters只是为了给服务单详情展示的信息,不需要在单据中体现 + self.details.pop("clusters", None) + service_id = SystemSettings.get_setting_value(SystemSettingsEnum.BK_ITSM_SERVICE_ID.value) + title = self.ticket.get_ticket_type_display() + params = { + "service_id": service_id, + "creator": self.ticket.creator, + "fields": [ + {"key": "title", "value": title}, + {"key": "bk_biz_id", "value": self.ticket.bk_biz_id}, + {"key": "approver", "value": self.get_approvers()}, + { + "key": "summary", + "value": _("{creator}提交了{title}的单据,请查看详情后进行审批").format(creator=self.ticket.creator, title=title), + }, + ], + "dynamic_fields": [ + { + "name": _("单据链接"), + "type": "LINK", + "value": self.ticket.url, + }, + { + "name": _("需求信息"), + "type": "LINK", + "value": f"{self.ticket.url}&isFullscreen=true", + }, + ], + "meta": { + "callback_url": f"{env.BK_SAAS_CALLBACK_URL}/apis/tickets/{self.ticket.id}/callback/", + "state_processors": {}, + }, + } + params = super().inject_callback_in_params(params=params) + + if env.ENVIRONMENT == "dev": + logger.debug("flow.itsm.params: \n%s\n", json.dumps(params, indent=2)) + + return params + + +class PauseParamBuilder(CallBackBuilderMixin): + """ + Pause 参数构造器 + 职责:为暂停任务提供单据参数 + 预写参数: + - pause_type: 可表示暂停的类型 + """ + + def __init__(self, ticket: Ticket): + self.ticket = ticket + self.ticket_data = copy.deepcopy(ticket.details) + self.params = {"pause_type": None} + + def format(self): + """ + 这里可以为params添加更多参数 + 适配更加复杂的场景 + """ + pass + + def get_params(self): + self.format() + self.params = super().inject_callback_in_params(params=self.params) + return self.params + + +class ResourceApplyParamBuilder(CallBackBuilderMixin): + """ + ResourceApply资源申请 参数构造器 + 职责:为资源申请提供额外参数,并为后继的inner flow节点更新信息 + """ + + def __init__(self, ticket: Ticket): + self.ticket = ticket + self.ticket_data = copy.deepcopy(ticket.details) + + def format(self): + """ + 这里可以为params添加更多参数 + 适配更加复杂的场景 + """ + pass + + def get_params(self): + self.format() + super().add_common_params() + super().inject_callback_in_params(params=self.ticket_data) + return self.ticket_data + + def post_callback(self): + """ + 部署单据需要有特殊的参数填充或者逻辑处理, + 需要在各自的ResourceApplyParamBuilder重写post_callback + """ + pass + + def patch_info_affinity_location(self, roles=None): + """ + 批量节点变更的时候,补充亲和性和位置参数 + """ + from backend.ticket.builders.common.base import fetch_cluster_ids + + cluster_ids = fetch_cluster_ids(self.ticket_data["infos"]) + id__cluster = {cluster.id: cluster for cluster in Cluster.objects.filter(id__in=cluster_ids)} + for info in self.ticket_data["infos"]: + cluster = id__cluster[info.get("cluster_id") or info.get("src_cluster")] + self.patch_affinity_location(cluster, info["resource_spec"], roles) + # 工具箱操作,补充业务和云区域ID + info.update(bk_cloud_id=cluster.bk_cloud_id, bk_biz_id=self.ticket.bk_biz_id) + + @classmethod + def patch_affinity_location(cls, cluster, resource_spec, roles=None): + """ + 节点变更的时候,补充亲和性和位置参数 + """ + resource_role = roles or resource_spec.keys() + for role in resource_role: + resource_spec[role]["affinity"] = cluster.disaster_tolerance_level + resource_spec[role]["location_spec"] = {"city": cluster.region, "sub_zone_ids": []} + + +class TicketFlowBuilder: + """ + 单据流程构建器 + 职责:定义单据流程(ticket_flow),实例化单据流程对象并结合 FlowParamBuilder/ItsmParamBuilder 生成所需参数 + """ + + ticket_type = None + group = None + serializer = None + + # 默认的参数构造器 + inner_flow_name: str = "" + inner_flow_builder: FlowParamBuilder = None + pause_node_builder: PauseParamBuilder = PauseParamBuilder + + # resource_apply_builder和resource_batch_apply_builder只能存在其一,表示是资源池单次申请还是批量申请 + resource_apply_builder: ResourceApplyParamBuilder = None + resource_batch_apply_builder: ResourceApplyParamBuilder = None + + # inner flow互斥的重试类型,默认为自动重试 + retry_type: FlowRetryType = FlowRetryType.AUTO_RETRY + # 默认是否需要审批,人工确认。后续用于初始化单据配置表 + default_need_itsm: bool = True + default_need_manual_confirm: bool = True + # 是否用户可修改单据流程(在单据配置表中) + editable: bool = True + + def __init__(self, ticket: Ticket): + self.ticket = ticket + + @classmethod + def name(cls): + return cls.__name__ + + @classmethod + def type(cls): + return cls.__name__.lower() + + @classmethod + def enabled(cls) -> bool: + """ + 是否开启,默认开启 + 可考虑使用功能开关控制 + """ + return True + + @property + def need_itsm(self): + """是否需要itsm审批节点。后续默认从单据配置表获取。子类可覆写,覆写以后editable为False""" + assert self.ticket_type is not None, "Please make sure FlowBuilder set the ticket type! " + return TicketFlowConfig.objects.get(ticket_type=self.ticket_type).configs["need_itsm"] + + @property + def need_manual_confirm(self): + """是否需要人工确认节点。后续默认从单据配置表获取。子类可覆写,覆写以后editable为False""" + assert self.ticket_type is not None, "Please make sure FlowBuilder set the ticket type! " + return TicketFlowConfig.objects.get(ticket_type=self.ticket_type).configs["need_manual_confirm"] + + @property + def need_resource_pool(self): + """是否存在资源池接入""" + return self.ticket.details.get("ip_source") == IpSource.RESOURCE_POOL + + def custom_ticket_flows(self): + return [] + + def init_ticket_flows(self): + """ + 自定义流程,默认流程是: + 单据审批(可选, 默认有) --> 人工确认(可选, 默认无) --> 资源申请(由单据参数判断) ---> inner节点 --> 资源交付(由单据参数判断) + 如果有特殊的flow需求,可在custom_ticket_flows中定制,会替换掉inner节点为custom流程 + 对于复杂流程,可以直接覆写init_ticket_flows + """ + flows = [] + + # 判断并添加审批节点 + if self.need_itsm: + flows.append( + Flow( + ticket=self.ticket, + flow_type=FlowType.BK_ITSM.value, + details=ItsmParamBuilder(self.ticket).get_params(), + flow_alias=_("单据审批"), + ) + ) + + # 判断并添加人工确认节点 + if self.need_manual_confirm: + flows.append( + Flow( + ticket=self.ticket, + flow_type=FlowType.PAUSE.value, + details=self.pause_node_builder(self.ticket).get_params(), + flow_alias=_("人工确认"), + ), + ) + + # 判断并添加资源申请节点 + if self.need_resource_pool: + + if not self.resource_apply_builder: + flow_type, resource_builder = FlowType.RESOURCE_BATCH_APPLY, self.resource_batch_apply_builder + else: + flow_type, resource_builder = FlowType.RESOURCE_APPLY, self.resource_apply_builder + + flows.append( + Flow( + ticket=self.ticket, + flow_type=flow_type, + details=resource_builder(self.ticket).get_params(), + flow_alias=_("资源申请"), + ), + ) + + # 若单据有特殊的自定义流程,则优先使用。否则使用默认的 inner_param_builder + custom_ticket_flows = self.custom_ticket_flows() + if custom_ticket_flows: + flows.extend(custom_ticket_flows) + else: + flows.append( + Flow( + ticket=self.ticket, + flow_type=FlowType.INNER_FLOW.value, + details=self.inner_flow_builder(self.ticket).get_params(), + flow_alias=self.inner_flow_name, + retry_type=self.retry_type, + ) + ) + + # 如果使用资源池,则在最后需要进行资源交付 + if self.need_resource_pool: + flow_type = FlowType.RESOURCE_DELIVERY if self.resource_apply_builder else FlowType.RESOURCE_BATCH_DELIVERY + flows.append(Flow(ticket=self.ticket, flow_type=flow_type)) + + Flow.objects.bulk_create(flows) + return list(Flow.objects.filter(ticket=self.ticket)) + + def patch_ticket_detail(self): + """自定义补充单据详情,留给子类实现""" + pass + + @classmethod + def _add_itsm_pause_describe(cls, flow_desc, flow_config_map): + if flow_config_map[cls.ticket_type]["need_itsm"]: + flow_desc.append(FlowType.get_choice_label(FlowType.BK_ITSM)) + if flow_config_map[cls.ticket_type]["need_manual_confirm"]: + flow_desc.append(FlowType.get_choice_label(FlowType.PAUSE)) + return flow_desc + + @classmethod + def describe_ticket_flows(cls, flow_config_map): + """ + @param flow_config_map: 单据类型与配置的映射 + 单据构造类的默认流程描述,固定为: + 单据审批(可选, 默认有) --> 人工确认(可选, 默认有) --> 资源申请(由单据参数判断) ---> inner节点 --> 资源交付(由单据参数判断) + 如果子类覆写了custom_ticket_flows/init_ticket_flows,则同时需要覆写该方法 + """ + need_resource = (cls.resource_apply_builder or cls.resource_batch_apply_builder) is not None + flow_desc = cls._add_itsm_pause_describe(flow_desc=[], flow_config_map=flow_config_map) + if need_resource: + flow_desc.append(FlowType.get_choice_label(FlowType.RESOURCE_APPLY)) + if cls.inner_flow_name: + flow_desc.append(cls.inner_flow_name) + if need_resource: + flow_desc.append(FlowType.get_choice_label(FlowType.RESOURCE_DELIVERY)) + + return flow_desc + + +class BuilderFactory: + # 单据的注册器类集合 + registry = {} + # 部署类单据集合 + apply_ticket_type = [] + # 单据与集群状态的映射 + ticket_type__cluster_phase = {} + # 单据和集群类型的映射 + ticket_type__cluster_type = {} + + @classmethod + def register(cls, ticket_type: str, **kwargs) -> Callable: + """ + 将单据构造类注册到注册器中 + @param ticket_type: 单据类型 + @param kwargs: 单据注册的额外信息,主要是将单据归为不同的集合中,目前有这几种类型 + 1. is_apply: bool ---- 表示单据是否是部署类单据(类似集群的部署,扩容,替换等) + 2. phase: ClusterPhase ---- 表示单据与集群状态的映射 + 3. cluster_type: ClusterType ---- 表示单据与集群类型的映射 + """ + + def inner_wrapper(wrapped_class: TicketFlowBuilder) -> TicketFlowBuilder: + wrapped_class.ticket_type = ticket_type + if ticket_type in cls.registry: + logger.warning(f"Builder [{ticket_type}] already exists. Will replace it") + cls.registry[ticket_type] = wrapped_class + + if kwargs.get("is_apply") and kwargs.get("is_apply") not in cls.apply_ticket_type: + cls.apply_ticket_type.append(ticket_type) + if kwargs.get("phase"): + cls.ticket_type__cluster_phase[ticket_type] = kwargs["phase"] + if kwargs.get("cluster_type"): + cls.ticket_type__cluster_type[ticket_type] = kwargs["cluster_type"] + + return wrapped_class + + return inner_wrapper + + @classmethod + def get_builder_cls(cls, ticket_type: str): + """获取构造器类""" + if ticket_type not in cls.registry: + logger.warning(f"Ticket Type: [{ticket_type}] does not exist in the registry") + raise NotImplementedError + + return cls.registry[ticket_type] + + @classmethod + def get_serializer(cls, ticket_type: str): + try: + return cls.get_builder_cls(ticket_type).serializer() + except NotImplementedError: + return serializers.Serializer() + + @classmethod + def create_builder(cls, ticket: Ticket): + """创建构造器实例""" + builder_cls = cls.get_builder_cls(ticket.ticket_type) + return builder_cls(ticket) + + +def register_all_builders(path=os.path.dirname(__file__), module_path="backend.ticket.builders"): + """递归注册当前目录下所有的构建器""" + for name in os.listdir(path): + # 忽略无效文件 + if name.endswith(".pyc") or name in ["__init__.py", "__pycache__"]: + continue + + if os.path.isdir(os.path.join(path, name)): + register_all_builders(os.path.join(path, name), ".".join([module_path, name])) + else: + try: + module_name = name.replace(".py", "") + import_path = ".".join([module_path, module_name]) + importlib.import_module(import_path) + except ModuleNotFoundError as e: + logger.warning(e) diff --git a/dbm-ui/backend/ticket/tasks/ticket_tasks.py b/dbm-ui/backend/ticket/tasks/ticket_tasks.py index 27fb76465f..459fdd2656 100644 --- a/dbm-ui/backend/ticket/tasks/ticket_tasks.py +++ b/dbm-ui/backend/ticket/tasks/ticket_tasks.py @@ -20,7 +20,7 @@ from celery.result import AsyncResult from django.db.models import Q from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend import env from backend.components import BKLogApi diff --git a/dbm-ui/backend/ticket/todos/__init__.py b/dbm-ui/backend/ticket/todos/__init__.py index bafffa53a9..dbe3828083 100644 --- a/dbm-ui/backend/ticket/todos/__init__.py +++ b/dbm-ui/backend/ticket/todos/__init__.py @@ -14,7 +14,7 @@ from dataclasses import asdict, dataclass from typing import Callable -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.ticket.models import Todo from blue_krill.data_types.enum import EnumField, StructuredEnum diff --git a/dbm-ui/backend/ticket/views.py b/dbm-ui/backend/ticket/views.py index ec3634b01a..b28fc0b0be 100644 --- a/dbm-ui/backend/ticket/views.py +++ b/dbm-ui/backend/ticket/views.py @@ -15,7 +15,7 @@ from django.db import transaction from django.db.models import Q from django.forms.models import model_to_dict -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from drf_yasg.utils import swagger_auto_schema from rest_framework import serializers, status from rest_framework.decorators import action diff --git a/dbm-ui/backend/utils/string.py b/dbm-ui/backend/utils/string.py index ae30ee2f15..02476d9949 100644 --- a/dbm-ui/backend/utils/string.py +++ b/dbm-ui/backend/utils/string.py @@ -13,7 +13,7 @@ import re from typing import Any, List, Optional, Tuple, Union -from django.utils.translation import ugettext +from django.utils.translation import gettext MIN_FORMAT_JSON_LENGTH = 30 @@ -170,7 +170,7 @@ def format_json_string(msg: str) -> str: def i18n_str(string): # 翻译字符串 if isinstance(string, str): - return ugettext(string) + return gettext(string) return string diff --git a/dbm-ui/backend/utils/time.py b/dbm-ui/backend/utils/time.py index a586c12834..d1bd6c1fd6 100644 --- a/dbm-ui/backend/utils/time.py +++ b/dbm-ui/backend/utils/time.py @@ -15,7 +15,7 @@ from dateutil.parser import parse as time_parse from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.constants import DATE_PATTERN, DATETIME_PATTERN from backend.exceptions import ValidationError diff --git a/dbm-ui/backend/version_log/config.py b/dbm-ui/backend/version_log/config.py index a17532aa2c..c30e8ebdc8 100644 --- a/dbm-ui/backend/version_log/config.py +++ b/dbm-ui/backend/version_log/config.py @@ -15,7 +15,7 @@ import re from django.conf import settings -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ __all__ = ("MD_FILES_DIR", "PARSED_HTML_FILES_DIR", "NAME_PATTERN", "LATEST_VERSION_INFORM", "ENTRANCE_URL") diff --git a/dbm-ui/backend/version_log/models.py b/dbm-ui/backend/version_log/models.py index 0083a5f723..3728ae774e 100644 --- a/dbm-ui/backend/version_log/models.py +++ b/dbm-ui/backend/version_log/models.py @@ -12,7 +12,7 @@ """ from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.version_log.config import NO_VERSION_CONSTANT from backend.version_log.utils import is_later_version diff --git a/dbm-ui/backend/version_log/views.py b/dbm-ui/backend/version_log/views.py index ae623a7481..6092c798b2 100644 --- a/dbm-ui/backend/version_log/views.py +++ b/dbm-ui/backend/version_log/views.py @@ -15,7 +15,7 @@ import logging from django.http import JsonResponse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from backend.version_log import config from backend.version_log.models import VersionLogVisited diff --git a/helm-charts/bk-dbm/charts/db-remote-service/Chart.yaml b/helm-charts/bk-dbm/charts/db-remote-service/Chart.yaml index 7854c29baa..62160bc788 100644 --- a/helm-charts/bk-dbm/charts/db-remote-service/Chart.yaml +++ b/helm-charts/bk-dbm/charts/db-remote-service/Chart.yaml @@ -21,4 +21,4 @@ version: 0.9.5 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 0.0.1-alpha.2 +appVersion: 0.0.1-alpha.13 diff --git a/helm-charts/bk-dbm/charts/db-remote-service/templates/deployment.yaml b/helm-charts/bk-dbm/charts/db-remote-service/templates/deployment.yaml index cb05ca003a..651abd079a 100644 --- a/helm-charts/bk-dbm/charts/db-remote-service/templates/deployment.yaml +++ b/helm-charts/bk-dbm/charts/db-remote-service/templates/deployment.yaml @@ -57,14 +57,24 @@ spec: - name: {{ $key }} value: {{ quote $val }} {{- end }} - # livenessProbe: - # httpGet: - # path: /ping - # port: http - # readinessProbe: - # httpGet: - # path: /ping - # port: http + livenessProbe: + httpGet: + path: /ping + port: http + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}} + periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}} + successThreshold: {{ .Values.livenessProbe.successThreshold | default 1}} + failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}} + readinessProbe: + httpGet: + path: /ping + port: http + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}} + periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}} + successThreshold: {{ .Values.livenessProbe.successThreshold | default 1}} + failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}} resources: {{- toYaml .Values.resources | nindent 12 }} # volumeMounts: @@ -76,10 +86,9 @@ spec: # name: config-volume # subPath: path/to/config.yaml # mountPath: /conf/config.yaml - {{- with .Values.nodeSelector }} + # 注意,如果部署 drs 的 node 有变更,需要对所有已部署的 DB 刷新权限 nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} + bk-dbm: db-remote-service {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/helm-charts/bk-dbm/charts/db-remote-service/values.yaml b/helm-charts/bk-dbm/charts/db-remote-service/values.yaml index d48cec6760..8a650f9f44 100644 --- a/helm-charts/bk-dbm/charts/db-remote-service/values.yaml +++ b/helm-charts/bk-dbm/charts/db-remote-service/values.yaml @@ -75,6 +75,10 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 +livenessProbe: {} + +readinessProbe: {} + nodeSelector: {} tolerations: [] @@ -86,7 +90,7 @@ envs: DRS_MYSQL_ADMIN_PASSWORD: gcs_admin_password DRS_MYSQL_ADMIN_USER: gcs_admin DRS_PROXY_ADMIN_PASSWORD: gcs_admin_password - DRS_PROXY_ADMIN_USER: gcs_admin + DRS_PROXY_ADMIN_USER: proxy DRS_PORT: 80 DRS_LOG_JSON: true # 是否使用 json 格式日志 DRS_LOG_CONSOLE: true # 是否在 stdout 打印日志 diff --git a/helm-charts/bk-dbm/values.yaml b/helm-charts/bk-dbm/values.yaml index 5072867803..23b6d5a7e5 100644 --- a/helm-charts/bk-dbm/values.yaml +++ b/helm-charts/bk-dbm/values.yaml @@ -3,7 +3,7 @@ # global values global: imageRegistry: "" - imagePullSecrets: [] + imagePullSecrets: [ ] storageClass: "" bkDomain: "example.com" ## 蓝鲸主域名访问协议http/https @@ -57,7 +57,7 @@ bk: bkApigwStaticVersion: "1.0.1" bkApigwManagerMaintainers: "admin" bkApigwStageName: "prod" - bkApigwGrantApps: [] + bkApigwGrantApps: [ ] bkApigwResourceDocsArchiveFile: "" bkApigatewayDomain: "" @@ -123,7 +123,7 @@ dbm: paths: - path: / pathType: ImplementationSpecific - tls: [] + tls: [ ] ingressPublic: # 在跨云管控场景下,需要配置公网 clb 进行访问 @@ -133,7 +133,7 @@ dbm: paths: - path: / pathType: ImplementationSpecific - tls: [] + tls: [ ] autoscaling: enabled: false @@ -327,7 +327,7 @@ db-resource: dataId: 1 db-remote-service: - enabled: false + enabled: true envs: # apm TRACE_SERVICE_NAME: db-remote-service @@ -417,7 +417,7 @@ stakater: # bitnami mysql 配置项 mysql: enabled: false - commonAnnotations: {} + commonAnnotations: { } max_allowed_packet: 128M nameOverride: mysql