コード例 #1
0
    def uploadToConfigCache(self, user, group = 'CMSYAAT',
                                label       = "Autogenerated by CMSYAAT",
                                description = "Autogenerated by CMSYAAT \n" +
                                    "http://github.com/PeriousApricot/CMSYAAT"
                                ):
        """
        uploads this object to a ConfigCache instance. ConfigCache is the
        subsystem that stores CMSSW configurations so every bit of infrastructure
        doesn't have to ship them around.
        
        Returns a URL that can later be used to retrieve the configuration
        """
        
        cache = ConfigCache()

        # TODO refactor this into a helper function
        couchHost = '/'.join(self.endpoint.split('/')[:-1])
        couchDB   = self.endpoint.split('/')[-1]

        return cache.upload( self.configObject,
                      group       = group,
                      userDN      = user,
                      label       = label,
                      description = description,
                      url         = couchHost,
                      database    = couchDB)
コード例 #2
0
                  help="Username to store as", default=pwd.getpwuid(os.getuid()))
parser.add_option("-g", "--group", dest="group",
                  help="Group to store as", default="CMSYAAT")
parser.add_option("--hostname", dest="hostname",
                  help="Target couch instance (formatted as http://andrewmelo.cloudant.com:5984)",
                  default="http://se2.accre.vanderbilt.edu:5985")
parser.add_option("-d", "--database", dest="database",
                  help="Target database", default="wmagent_configcache")

(options, args) = parser.parse_args()

# Load the config initially (takes forever)
cacheFile = ConfigCache()
config = cacheFile.loadConfig( options.filename )
for filename in args:
    # Modify the config for this filename
    targetName = "%s%s" % ( options.prefix, os.path.basename( filename ) )
    config.process.source = cms.Source("LHESource",
        fileNames = cms.untracked.vstring(targetName)
    )

    # Upload the config to the cache
    target = cacheFile.upload(config, options.user, options.group,
                    url=options.hostname,
                    database=options.database,
                #    arguments=args,
                    label = os.path.basename(filename),
                    description = "LHE for SusyScan. Generated by Andrew Melo",
                    )
    print "Uploaded %s to %s" % ( os.path.basename(filename), target )