From 35fb6a81f951fb494570e67543821c291fcda0bd Mon Sep 17 00:00:00 2001 From: shagi Date: Mon, 27 Sep 2021 10:36:22 +0200 Subject: [PATCH] Dont break removing unexisten ipfs pin on local --- negromate/web/commands/ipfs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/negromate/web/commands/ipfs.py b/negromate/web/commands/ipfs.py index 9400beb..ae05e26 100644 --- a/negromate/web/commands/ipfs.py +++ b/negromate/web/commands/ipfs.py @@ -98,8 +98,11 @@ def run(args, **kwargs): 'rm', previous_hash, ] - subprocess.check_call(command) - logger.info('Previous hash unpinned on local') + result = subprocess.run(command) + if result.returncode != 0: + logger.info('Previous {} hash not removed: {}'.format(previous_hash, result.stdout)) + else: + logger.info('Previous hash unpinned on local') # remove previous pin on server data = urllib.parse.urlencode({