From b2c2325abaa0539988507d77f53e0eacf84ba679 Mon Sep 17 00:00:00 2001 From: Matt Tesauro Date: Sun, 12 Feb 2023 20:37:47 -0600 Subject: [PATCH] Update how fixtures are loaded --- godojo.go | 2 +- ubuntu.go | 57 ++++++++++++++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/godojo.go b/godojo.go index 9a4f966..a3d22b1 100644 --- a/godojo.go +++ b/godojo.go @@ -37,7 +37,7 @@ var embd embed.FS // Global vars var ( // Installer version - ver = "1.1.8" + ver = "1.1.9" // Configuration file name cf = "dojoConfig.yml" // Global config struct diff --git a/ubuntu.go b/ubuntu.go index 0cf4871..cd66758 100644 --- a/ubuntu.go +++ b/ubuntu.go @@ -371,40 +371,49 @@ func ubuntuSetupDDjango(id string, inst *config.InstallConfig, b *osCmds) { "Failed while setting the password for the DefectDojo superuser", true) // Roles showed up in 2.x.x - if onlyAfter(inst.Version, 2, 0, 0) { - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata role", - "Failed while the loading data for role", true) - } + //if onlyAfter(inst.Version, 2, 0, 0) { + // addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata role", + // "Failed while the loading data for role", true) + //} + + addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata "+ + "system_settings initial_banner_conf product_type test_type development_environment benchmark_type "+ + "benchmark_category benchmark_requirement language_type objects_review regulation initial_surveys role", + "Failed while the loading data for a default install", true) + + // + addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py migrate_textquestions", + "Failed while the loading data for a default survey questions", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata product_type", - "Failed while the loading data for product_type", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata product_type", + // "Failed while the loading data for product_type", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata test_type", - "Failed while the loading data for test_type", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata test_type", + // "Failed while the loading data for test_type", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata development_environment", - "Failed while the loading data for development_environment", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata development_environment", + // "Failed while the loading data for development_environment", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata system_settings", - "Failed while the loading data for system_settings", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata system_settings", + // "Failed while the loading data for system_settings", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_type", - "Failed while the loading data for benchmark_type", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_type", + // "Failed while the loading data for benchmark_type", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_category", - "Failed while the loading data for benchmark_category", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_category", + // "Failed while the loading data for benchmark_category", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_requirement", - "Failed while the loading data for benchmark_requirement", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata benchmark_requirement", + // "Failed while the loading data for benchmark_requirement", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata language_type", - "Failed while the loading data for language_type", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata language_type", + // "Failed while the loading data for language_type", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata objects_review", - "Failed while the loading data for objects_review", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata objects_review", + // "Failed while the loading data for objects_review", true) - addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata regulation", - "Failed while the loading data for regulation", true) + //addCmd(b, "cd "+inst.Root+"/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata regulation", + // "Failed while the loading data for regulation", true) // removed - "cd " + inst.Root + "/django-DefectDojo && source ../bin/activate && python3 manage.py import_surveys", "Failed while the running import_surveys", // removed - "cd " + inst.Root + "/django-DefectDojo && source ../bin/activate && python3 manage.py loaddata initial_surveys", "Failed while the loading data for initial_surveys",