File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 2
2
import nixops .plugins
3
3
from nixops .storage import StorageBackend
4
4
from nixops .storage .legacy import LegacyBackend
5
+ from nixops .storage .memory import MemoryBackend
5
6
6
7
7
8
@nixops .plugins .hookimpl
8
9
def register_backends () -> Dict [str , Type [StorageBackend ]]:
9
- return {"legacy" : LegacyBackend }
10
+ return {"legacy" : LegacyBackend , "memory" : MemoryBackend }
Original file line number Diff line number Diff line change
1
+ import nixops .statefile
2
+ from nixops .storage import StorageArgDescriptions , StorageArgValues
3
+
4
+
5
+ class MemoryBackend :
6
+ @staticmethod
7
+ def arguments () -> StorageArgDescriptions :
8
+ raise NotImplementedError
9
+
10
+ def __init__ (self , args : StorageArgValues ) -> None :
11
+ pass
12
+
13
+ # fetchToFile: acquire a lock and download the state file to
14
+ # the local disk. Note: no arguments will be passed over kwargs.
15
+ # Making it part of the type definition allows adding new
16
+ # arguments later.
17
+ def fetchToFile (self , path : str , ** kwargs ) -> None :
18
+ pass
19
+
20
+ def onOpen (self , sf : nixops .statefile .StateFile , ** kwargs ) -> None :
21
+ sf .create_deployment ()
22
+
23
+ # uploadFromFile: upload the new state file and release any locks
24
+ # Note: no arguments will be passed over kwargs. Making it part of
25
+ # the type definition allows adding new arguments later.
26
+ def uploadFromFile (self , path : str , ** kwargs ) -> None :
27
+ pass
You can’t perform that action at this time.
0 commit comments