Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nixops/storage/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import sys
import os
import os.path
from typing import Optional
from nixops.util import ImmutableValidatedObject


class LegacyBackendOptions(ImmutableValidatedObject):
pass
databasefile: Optional[str]


class LegacyBackend(StorageBackend[LegacyBackendOptions]):
Expand All @@ -18,7 +19,7 @@ def options(**kwargs) -> LegacyBackendOptions:
return LegacyBackendOptions(**kwargs)

def __init__(self, args: LegacyBackendOptions) -> None:
pass
self.args = args

# fetchToFile: acquire a lock and download the state file to
# the local disk. Note: no arguments will be passed over kwargs.
Expand All @@ -35,6 +36,9 @@ def state_location(self) -> str:
if env_override is not None:
return env_override

if self.args.databasefile is not None:
return self.args.databasefile

home_dir = os.environ.get("HOME", "")
charon_dir = f"{home_dir}/.charon"
nixops_dir = f"{home_dir}/.nixops"
Expand Down