aboutsummaryrefslogtreecommitdiff
path: root/scenarios
diff options
context:
space:
mode:
Diffstat (limited to 'scenarios')
-rw-r--r--scenarios/fragments/garage.py9
-rwxr-xr-xscenarios/garage-manual7
2 files changed, 13 insertions, 3 deletions
diff --git a/scenarios/fragments/garage.py b/scenarios/fragments/garage.py
index cd8b888..f886b33 100644
--- a/scenarios/fragments/garage.py
+++ b/scenarios/fragments/garage.py
@@ -30,7 +30,7 @@ keys = key_api.KeyApi(api)
# Setup, launch on import
storage_path = Path(shared.storage_path) / "garage" / env['HOST']
-if 'ZONE' in env:
+if 'ZONE' in env and env['ZONE'] != "":
storage_path = Path(shared.storage_path) / "garage" / env['ZONE'] / env['HOST']
config = storage_path / "garage.toml"
env['GARAGE_CONFIG_FILE'] = str(config)
@@ -117,14 +117,17 @@ admin_token = "{admin}"
f.write(json.dumps({
"node_addr": f"{node_id}@{env['IP']}:3901",
"node_id": node_id,
- "zone": env['ZONE'],
+ "zone": env['ZONE'] if 'ZONE' in env and env['ZONE'] != "" else env['HOST'],
"host": env['HOST'],
}))
def destroy():
dpid = Path(storage_path) / "daemon.pid"
if exists(dpid):
- shared.exec(f"kill -9 $(cat {dpid})")
+ try:
+ shared.exec(f"kill -9 $(cat {dpid})")
+ except:
+ pass
shared.exec(f"rm -f {dpid}")
if len(str(storage_path)) < 8: # arbitrary, stupid safe guard
print(storage_path)
diff --git a/scenarios/garage-manual b/scenarios/garage-manual
new file mode 100755
index 0000000..f2dfcc9
--- /dev/null
+++ b/scenarios/garage-manual
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+from fragments import garage, s3lat, shared
+
+if shared.id() == 1:
+ garage.deploy_coord()
+else:
+ garage.deploy_follow()