mirror of https://github.com/jumpserver/jumpserver
fix: 修复迁移数据库应用账号缺少的问题
parent
b8c872c68e
commit
bfa2e285f5
|
@ -77,6 +77,11 @@ class CommandStorage(CommonStorageModelMixin, JMSBaseModel):
|
||||||
def config(self):
|
def config(self):
|
||||||
config = self.meta
|
config = self.meta
|
||||||
config.update({'TYPE': self.type})
|
config.update({'TYPE': self.type})
|
||||||
|
# 处理 hosts 对象, 正常应该是list, 但是有时候是 str, debug 未果
|
||||||
|
hosts = config.get('HOSTS', [])
|
||||||
|
if isinstance(hosts, str) and ',' in hosts:
|
||||||
|
hosts = hosts.split(',')
|
||||||
|
config['HOSTS'] = hosts
|
||||||
return copy.deepcopy(config)
|
return copy.deepcopy(config)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -178,7 +178,6 @@ command_storage_type_serializer_classes_mapping = {
|
||||||
|
|
||||||
# BaseStorageSerializer
|
# BaseStorageSerializer
|
||||||
class BaseStorageSerializer(serializers.ModelSerializer):
|
class BaseStorageSerializer(serializers.ModelSerializer):
|
||||||
type = LabeledChoiceField(choices=const.ReplayStorageType.choices, label=_('Type'))
|
|
||||||
storage_type_serializer_classes_mapping = {}
|
storage_type_serializer_classes_mapping = {}
|
||||||
meta = MethodSerializer()
|
meta = MethodSerializer()
|
||||||
|
|
||||||
|
@ -222,6 +221,7 @@ class BaseStorageSerializer(serializers.ModelSerializer):
|
||||||
|
|
||||||
# CommandStorageSerializer
|
# CommandStorageSerializer
|
||||||
class CommandStorageSerializer(BaseStorageSerializer):
|
class CommandStorageSerializer(BaseStorageSerializer):
|
||||||
|
type = LabeledChoiceField(choices=const.CommandStorageType.choices, label=_('Type'))
|
||||||
storage_type_serializer_classes_mapping = command_storage_type_serializer_classes_mapping
|
storage_type_serializer_classes_mapping = command_storage_type_serializer_classes_mapping
|
||||||
|
|
||||||
class Meta(BaseStorageSerializer.Meta):
|
class Meta(BaseStorageSerializer.Meta):
|
||||||
|
@ -233,6 +233,7 @@ class CommandStorageSerializer(BaseStorageSerializer):
|
||||||
|
|
||||||
# ReplayStorageSerializer
|
# ReplayStorageSerializer
|
||||||
class ReplayStorageSerializer(BaseStorageSerializer):
|
class ReplayStorageSerializer(BaseStorageSerializer):
|
||||||
|
type = LabeledChoiceField(choices=const.ReplayStorageType.choices, label=_('Type'))
|
||||||
storage_type_serializer_classes_mapping = replay_storage_type_serializer_classes_mapping
|
storage_type_serializer_classes_mapping = replay_storage_type_serializer_classes_mapping
|
||||||
|
|
||||||
class Meta(BaseStorageSerializer.Meta):
|
class Meta(BaseStorageSerializer.Meta):
|
||||||
|
|
Loading…
Reference in New Issue