From: Frederic Massart Date: Fri, 10 Aug 2012 06:42:26 +0000 (+0800) Subject: Moodle remove displays a nice error when missing permissions X-Git-Tag: v0.1~50 X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=f597f98fa95159438feea06a612cd39af2eadff6;p=mdk.git Moodle remove displays a nice error when missing permissions --- diff --git a/moodle-remove.py b/moodle-remove.py index ba77579..95ad246 100755 --- a/moodle-remove.py +++ b/moodle-remove.py @@ -30,5 +30,12 @@ if not args.do: sys.exit(0) debug('Removing %s...' % args.name) -Wp.delete(args.name) +try: + Wp.delete(args.name) +except OSError: + debug('Error while deleting the instance.') + debug('This is probably a permission issue.') + debug('Run: sudo chmod -R 0777 %s' % Wp.getPath(args.name)) + sys.exit(1) + debug('Instance removed')