mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Fix various errors when trying to run make bulk_data.
- Properly import PrimoridialModel. - Use floor division operator for range() method to avoid float vs int errors.
This commit is contained in:
@@ -40,10 +40,13 @@ from django.db import transaction # noqa
|
|||||||
# awx
|
# awx
|
||||||
from awx.main.models import ( # noqa
|
from awx.main.models import ( # noqa
|
||||||
Credential, CredentialType, Group, Host, Inventory, Job, JobEvent,
|
Credential, CredentialType, Group, Host, Inventory, Job, JobEvent,
|
||||||
JobHostSummary, JobTemplate, Label, Organization, PrimordialModel, Project,
|
JobHostSummary, JobTemplate, Label, Organization, Project,
|
||||||
Team, User, WorkflowJobTemplate, WorkflowJobTemplateNode,
|
Team, User, WorkflowJobTemplate, WorkflowJobTemplateNode,
|
||||||
batch_role_ancestor_rebuilding,
|
batch_role_ancestor_rebuilding,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from awx.main.models.base import PrimordialModel
|
||||||
|
|
||||||
from awx.main.signals import ( # noqa
|
from awx.main.signals import ( # noqa
|
||||||
disable_activity_stream,
|
disable_activity_stream,
|
||||||
disable_computed_fields
|
disable_computed_fields
|
||||||
@@ -695,7 +698,7 @@ def make_the_data():
|
|||||||
continue
|
continue
|
||||||
# Bulk create in chunks with maximum chunk size
|
# Bulk create in chunks with maximum chunk size
|
||||||
MAX_BULK_CREATE = 100
|
MAX_BULK_CREATE = 100
|
||||||
for j in range((n / MAX_BULK_CREATE) + 1):
|
for j in range((n // MAX_BULK_CREATE) + 1):
|
||||||
n_subgroup = MAX_BULK_CREATE
|
n_subgroup = MAX_BULK_CREATE
|
||||||
if j == n / MAX_BULK_CREATE:
|
if j == n / MAX_BULK_CREATE:
|
||||||
# on final pass, create the remainder
|
# on final pass, create the remainder
|
||||||
|
|||||||
Reference in New Issue
Block a user