updated view and database
This commit is contained in:
@@ -27,7 +27,7 @@ class AnsibleService:
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
self.db = get_db()
|
||||
self._db = None
|
||||
self.ansible_dir = Path("ansible")
|
||||
self.inventory_file = self.ansible_dir / "inventory" / "dynamic_inventory.yaml"
|
||||
self.playbook_dir = self.ansible_dir / "playbooks"
|
||||
@@ -42,6 +42,13 @@ class AnsibleService:
|
||||
(self.ansible_dir / "roles").mkdir(exist_ok=True)
|
||||
self.ssh_keys_dir.mkdir(mode=0o700, exist_ok=True)
|
||||
|
||||
@property
|
||||
def db(self):
|
||||
"""Lazily resolve the database handle (see LogCompressionService.db)."""
|
||||
if self._db is None:
|
||||
self._db = get_db()
|
||||
return self._db
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Settings helpers #
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
Reference in New Issue
Block a user