Skip to content

Commit

Permalink
fix repo list
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkala committed Dec 8, 2023
1 parent d375af0 commit 0912881
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions nautobot_golden_config/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from nautobot_golden_config.utilities.git import GitRepo
from nautobot_golden_config.utilities.helper import get_job_filter


name = "Golden Configuration" # pylint: disable=invalid-name


Expand Down Expand Up @@ -185,10 +184,20 @@ class Meta:
name = "Execute All Golden Configuration Jobs - Single Device"
description = "Process to run all Golden Configuration jobs configured."
has_sensitive_variables = False
repo_types = ["jinja_repository", "intended_repository", "backup_repository"]
repo_types = []

def run(self, *args, **data):
"""Run all jobs."""
repo_types = []
if constant.ENABLE_INTENDED:
repo_types.extend(["jinja_repository", "intended_repository"])
if constant.ENABLE_BACKUP:
repo_types.extend(["backup_repository"])
repo_types = list(set(repo_types) - set())
if constant.ENABLE_COMPLIANCE:
repo_types.extend(["intended_repository", "backup_repository"])

self.Meta.repo_types = repo_types
if constant.ENABLE_INTENDED:
IntendedJob().run.__func__(self, **data) # pylint: disable=too-many-function-args
if constant.ENABLE_BACKUP:
Expand All @@ -206,10 +215,20 @@ class Meta:
name = "Execute All Golden Configuration Jobs - Multiple Device"
description = "Process to run all Golden Configuration jobs configured against multiple devices."
has_sensitive_variables = False
repo_types = ["jinja_repository", "intended_repository", "backup_repository"]
repo_types = []

def run(self, *args, **data):
"""Run all jobs."""
repo_types = []
if constant.ENABLE_INTENDED:
repo_types.extend(["jinja_repository", "intended_repository"])
if constant.ENABLE_BACKUP:
repo_types.extend(["backup_repository"])
repo_types = list(set(repo_types) - set())
if constant.ENABLE_COMPLIANCE:
repo_types.extend(["intended_repository", "backup_repository"])

self.Meta.repo_types = repo_types
if constant.ENABLE_INTENDED:
IntendedJob().run.__func__(self, **data) # pylint: disable=too-many-function-args
if constant.ENABLE_BACKUP:
Expand Down

0 comments on commit 0912881

Please sign in to comment.