From 979283042329c940a19a26b4e29e608fc4c590df Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 4 Jul 2012 17:01:03 +0200 Subject: [PATCH] tweak - can call sfaadmin --help outside an sfa box --- sfa/client/sfaadmin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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): -- 2.43.0