diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-09-14 18:22:46 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-09-14 18:22:46 +0200 |
commit | f0db8ba560c882d3fe297b5433acc128dc2d9343 (patch) | |
tree | 3db6fea9467c16008826c7c90d2a6c625e2c8bad /scenarios/fragments/garage.py | |
parent | c75b239018e9fb8deadab6396f3fbdfafd982f0d (diff) | |
download | mknet-f0db8ba560c882d3fe297b5433acc128dc2d9343.tar.gz mknet-f0db8ba560c882d3fe297b5433acc128dc2d9343.zip |
Scenario based benchmarks will be ready soon
Diffstat (limited to 'scenarios/fragments/garage.py')
-rw-r--r-- | scenarios/fragments/garage.py | 9 |
1 files changed, 6 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) |