modified = False for arg in args: value = None section = None option = None if "=" in arg: arg, value = arg.split( "=" ) if "." in arg: section, option = arg.split( "." ) else: section = arg if value != None: dconfig.set( section, option, value ) modified = True else: retVal = dconfig.get( section, option ) if not retVal[ "OK" ]: critical( retVal[ "Message" ] ) ret = retVal[ "Value" ] if type( ret ) == type( [ ] ): print "[%s]" % section for o, v in ret: print o, "=", v else: print option, "=", ret if modified: dconfig.write( )
) Script.parseCommandLine( ignoreErrors = True ) args = Script.getPositionalArgs() session = DSession( ) if len( args ) > 1: print "Error: too many arguments provided\n%s:" % Script.scriptName Script.showHelp( ) DIRAC.exit( -1 ) if len( args ): arg = args[ 0 ] if not os.path.isabs( arg ): arg = os.path.normpath( os.path.join( session.getCwd( ), arg )) else: arg = session.homeDir( ) Script.enableCS( ) catalog = DCatalog( ) if catalog.isDir( arg ): if( session.getCwd( ) != arg ): session.setCwd( arg ) session.write( ) else: critical( "Error: \"%s\" not a valid directory" % arg )
Script.disableCS() Script.parseCommandLine(ignoreErrors=True) args = Script.getPositionalArgs() if params.minimal: createMinimalConfig() dconfig = DConfig() if not args: sections = dconfig.sections() for s in sections: retVal = dconfig.get(s, None) if not retVal["OK"]: critical(retVal["Message"]) print "[%s]" % s for o, v in retVal["Value"]: print o, "=", v print DIRAC.exit(0) modified = False for arg in args: value = None section = None option = None if "=" in arg:
retVal = session.listEnv( ) if not retVal[ "OK" ]: print "Error:", retVal[ "Message" ] DIRAC.exit( -1 ) for o, v in retVal[ "Value" ]: print o + "=" + v DIRAC.exit( 0 ) arg = args[ 0 ] section = None option = None if "." in arg: section, option = arg.split( "." ) else: option = arg ret = None if section: ret = session.get( section, option ) else: ret = session.getEnv( option ) if not ret[ "OK" ]: print critical( ret[ "Message" ] ) print ret[ "Value" ]