mirror of https://github.com/jumpserver/jumpserver
fix: 修复迁移的 sftp 数量不对
parent
859268f7f3
commit
09db2ad3e1
|
@ -49,11 +49,11 @@ def migrate_assets_sftp_protocol(apps, schema_editor):
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
print("\nAsset add sftp protocol: ")
|
print("\nAsset add sftp protocol: ")
|
||||||
asset_ids = asset_cls.objects\
|
asset_ids = list(asset_cls.objects\
|
||||||
.filter(platform__in=sftp_platforms)\
|
.filter(platform__in=sftp_platforms)\
|
||||||
.exclude(protocols__name='sftp')\
|
.exclude(protocols__name='sftp')\
|
||||||
.distinct()\
|
.distinct()\
|
||||||
.values_list('id', flat=True)
|
.values_list('id', flat=True))
|
||||||
while True:
|
while True:
|
||||||
_asset_ids = asset_ids[count:count + 1000]
|
_asset_ids = asset_ids[count:count + 1000]
|
||||||
if not _asset_ids:
|
if not _asset_ids:
|
||||||
|
|
Loading…
Reference in New Issue