summaryrefslogtreecommitdiffstats
path: root/tools/data_generators
diff options
context:
space:
mode:
authorAlanCoding <arominge@redhat.com>2017-01-21 18:45:40 +0100
committerAlanCoding <arominge@redhat.com>2017-01-25 15:51:24 +0100
commit36c68178dd74df304feb4c47cb4e563b72694c40 (patch)
treed8b7f80472da8dc45c981375f8a2c02572d5179f /tools/data_generators
parentRefactor of accessible_objects for polymorphic model (diff)
downloadawx-36c68178dd74df304feb4c47cb4e563b72694c40.tar.xz
awx-36c68178dd74df304feb4c47cb4e563b72694c40.zip
cleanup from accessible_objects refactor
Diffstat (limited to 'tools/data_generators')
-rw-r--r--tools/data_generators/presets.tsv30
-rwxr-xr-xtools/data_generators/rbac_dummy_data_generator.py17
2 files changed, 26 insertions, 21 deletions
diff --git a/tools/data_generators/presets.tsv b/tools/data_generators/presets.tsv
index 5ba5b4557f..02e2d8f28f 100644
--- a/tools/data_generators/presets.tsv
+++ b/tools/data_generators/presets.tsv
@@ -1,15 +1,15 @@
-resource medium jan2017
-organizations 500 1
-users 5000 3
-teams 500 2
-projects 1000 30
-job-templates 2000 127
-credentials 2000 50
-inventories 2000 6
-inventory-groups 500 15
-inventory-hosts 2500 15
-wfjts 100 0
-nodes 1000 0
-labels 1000 0
-jobs 1000 157208
-job-events 1000 3370942 \ No newline at end of file
+resource medium Jan2017 jobs1k jobs10k
+organizations 500 1 1 1
+users 5000 3 3 3
+teams 500 2 2 2
+projects 1000 30 30 30
+job_templates 2000 127 127 127
+credentials 2000 50 50 50
+inventories 2000 6 6 6
+inventory_groups 500 15 15 15
+inventory_hosts 2500 15 15 15
+wfjts 100 0 0 0
+nodes 1000 0 0 0
+labels 1000 0 0 0
+jobs 1000 157208 1000 10000
+job_events 1000 3370942 20000 200000 \ No newline at end of file
diff --git a/tools/data_generators/rbac_dummy_data_generator.py b/tools/data_generators/rbac_dummy_data_generator.py
index 910568f8d6..8fe910d401 100755
--- a/tools/data_generators/rbac_dummy_data_generator.py
+++ b/tools/data_generators/rbac_dummy_data_generator.py
@@ -490,7 +490,8 @@ try:
if project_idx == 0 and i == 0:
job_template.admin_role.members.add(jt_admin)
project_idx += 1
- print('')
+ if n > 0:
+ print('')
print('# Creating %d Workflow Job Templates' % n_wfjts)
org_idx = 0
@@ -511,7 +512,8 @@ try:
wfjt._is_new = _
wfjts.append(wfjt)
org_idx += 1
- print('')
+ if n:
+ print('')
print('# Creating %d Workflow Job Template nodes' % n_nodes)
wfjt_idx = 0
@@ -561,7 +563,8 @@ try:
parent_node.success_nodes.add(node)
parent_idx = (parent_idx + 7) % len(wfjt_nodes)
wfjt_idx += 1
- print('')
+ if n:
+ print('')
print('# Creating %d Labels' % n_labels)
org_idx = 0
@@ -580,7 +583,8 @@ try:
)
labels.append(label)
org_idx += 1
- print('')
+ if n:
+ print('')
label_gen = yield_choice(labels)
print('# Adding labels to job templates')
@@ -636,10 +640,9 @@ try:
jobs.append(job)
job_i += 1
if not job._is_new:
- job_template_idx += 1
group_idx += 1
continue
- if i+1 == n:
+ if i + 1 == n:
job_template.last_job = job
if job_template.pk % 5 == 0:
job_template.current_job = job
@@ -689,3 +692,5 @@ try:
except Rollback:
print('Rolled back changes')
pass
+
+print('')