From: Thierry Parmentelat Date: Wed, 4 Jul 2012 15:01:03 +0000 (+0200) Subject: tweak - can call sfaadmin --help outside an sfa box X-Git-Tag: sfa-2.1-12~13 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=979283042329c940a19a26b4e29e608fc4c590df;p=sfa.git tweak - can call sfaadmin --help outside an sfa box --- diff --git a/sfa/client/sfaadmin.py b/sfa/client/sfaadmin.py index 1e1d6758..6cb39368 100755 --- a/sfa/client/sfaadmin.py +++ b/sfa/client/sfaadmin.py @@ -14,6 +14,11 @@ from sfa.trust.gid import GID pprinter = PrettyPrinter(indent=4) +try: + help_basedir=Hierarchy().basedir +except: + help_basedir='*unable to locate Hierarchy().basedir' + def optparse_listvalue_callback(option, opt, value, parser): setattr(parser.values, option.dest, value.split(',')) @@ -172,9 +177,9 @@ class RegistryCommands(Commands): importer.run() @args('-a', '--all', dest='all', metavar='', action='store_true', default=False, - help='Remove all registry records and all files in %s area' % Hierarchy().basedir) + help='Remove all registry records and all files in %s area' % help_basedir) @args('-c', '--certs', dest='certs', metavar='', action='store_true', default=False, - help='Remove all cached certs/gids found in %s' % Hierarchy().basedir ) + help='Remove all cached certs/gids found in %s' % help_basedir ) @args('-0', '--no-reinit', dest='reinit', metavar='', action='store_false', default=True, help='Prevents new DB schema from being installed after cleanup') def nuke(self, all=False, certs=False, reinit=True):