Commit e1e328bf authored by Michael R's avatar Michael R
Browse files

Fix workflow migrate command

-add missing profile parameter for migrate's objects query
-extend possible for migration profiles list
parent c2eeb742
Pipeline #37252 passed with stages
in 27 minutes and 17 seconds
......@@ -19,7 +19,21 @@ from import WFMigration
class Command(BaseCommand):
help = "Workflow maintenance"
PROFILE_MAP = {"crm.SubscriberProfile": "crm.Subscriber", "crm.SupplierProfile": "crm.Supplier"}
"crm.SubscriberProfile": "crm.Subscriber",
"crm.SupplierProfile": "crm.Supplier",
"ip.AddressProfile": "ip.Address",
"ip.PrefixProfile": "ip.Prefix",
"phone.PhoneNumberProfile": "phone.PhoneNumber",
"phone.PhoneRangeProfile": "phone.PhoneRange",
"vc.L2DomainProfile": "vc.L2Domain",
"vc.VLANProfile": "vc.VLAN",
"vc.VPNProfile": "vc.VPN",
"inv.SensorProfile": "inv.Sensor",
"pm.AgentProfile": "pm.Agent",
"sa.ServiceProfile": "sa.Service",
"sla.SLAProfile": "sla.SLAProbe",
......@@ -73,10 +87,10 @@ class Command(BaseCommand):
self.print("No translations")
for ostate in tr:
c = imodel.objects.filter(
c = imodel.objects.filter(, profile=pid).count()
self.print(" %s -> %s: %d records" % (ostate, tr[ostate], c))
if c and not dry_run:
for o in imodel.objects.filter(
for o in imodel.objects.filter(, profile=pid):
def handle_expire(self, dry_run=False, model=None, *args, **kwargs):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment