Merge pull request #3292 from kialam/fix-dummy-data-generator-script-errors

Fix various errors when trying to run `make bulk_data`.

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-02-22 18:30:06 +00:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ from django.db.models.signals import pre_delete # noqa
# AWX # AWX
from awx.main.models.base import ( # noqa from awx.main.models.base import ( # noqa
BaseModel, prevent_search, CLOUD_INVENTORY_SOURCES, VERBOSITY_CHOICES BaseModel, PrimordialModel, prevent_search, CLOUD_INVENTORY_SOURCES, VERBOSITY_CHOICES
) )
from awx.main.models.unified_jobs import ( # noqa from awx.main.models.unified_jobs import ( # noqa
UnifiedJob, UnifiedJobTemplate, StdoutMaxBytesExceeded UnifiedJob, UnifiedJobTemplate, StdoutMaxBytesExceeded

View File

@@ -44,6 +44,7 @@ from awx.main.models import ( # noqa
Team, User, WorkflowJobTemplate, WorkflowJobTemplateNode, Team, User, WorkflowJobTemplate, WorkflowJobTemplateNode,
batch_role_ancestor_rebuilding, batch_role_ancestor_rebuilding,
) )
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 +696,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