X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=config%2Fsfa-config;h=93ebc0511811e52d1251fedfe6393a79b9406d98;hp=29aa179cdc6d06b0ba7c53655caa07cf70c2e0ed;hb=0a9902d2a55a0a9ac03601345c4284293669012b;hpb=f706f9f84a751369ac75891c26ab10f8f58717cd diff --git a/config/sfa-config b/config/sfa-config index 29aa179c..93ebc051 100755 --- a/config/sfa-config +++ b/config/sfa-config @@ -2,8 +2,6 @@ # # Script for basic access to the SFA configuration file store. # -# $Id$ -# import sys import os @@ -50,11 +48,12 @@ Usage: %s [OPTION]... [FILES] sys.exit(1) -def deprecated (message): - print "%s: deprecated usage"%sys.argv[0] +def deprecated(message): + print "%s: deprecated usage" % sys.argv[0] print message sys.exit(1) + def main(): config = Config() fileobjs = [] @@ -87,7 +86,7 @@ def main(): for (opt, optval) in opts: if opt == "--shell" or \ - opt == "--bash": + opt == "--bash": output = config.output_shell elif opt == "--python": output = config.output_python @@ -110,17 +109,17 @@ def main(): elif opt == "--value": variable['value'] = optval elif opt == "--group": -# group['id'] = optval + # group['id'] = optval deprecated("option --group deprecated -- use .lst files instead") elif opt == "--package": -# package['name'] = optval + # package['name'] = optval deprecated("option --package deprecated -- use .lst files instead") elif opt == "--type": package['type'] = optval elif opt == '-s' or opt == "--save": if not optval: usage() - print 'parsed save option',optval + print 'parsed save option', optval save = optval elif opt == '-h' or opt == "--help": usage() @@ -154,11 +153,11 @@ def main(): # --save if save: # create directory if needed - # so that plc.d/{api,postgres} can create configs/site.xml - dirname = os.path.dirname (save) - if (not os.path.exists (dirname)): - os.makedirs(dirname,0755) - if (not os.path.exists (dirname)): + # so that plc.d/{api,postgres} can create configs/site.xml + dirname = os.path.dirname(save) + if (not os.path.exists(dirname)): + os.makedirs(dirname, 0755) + if (not os.path.exists(dirname)): print "Cannot create dir %s - exiting" % dirname sys.exit(1) config.save(save)