From f0db8ba560c882d3fe297b5433acc128dc2d9343 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 14 Sep 2022 18:22:46 +0200 Subject: Scenario based benchmarks will be ready soon --- scenarios/fragments/garage.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scenarios/fragments') 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) -- cgit v1.2.3