def makeSandbox(self, directory, target = None): """ Generates a tarball from the directory given. Handles setting the CMSSW environment in a subshell so you don't have to. Writes the tarball to target if given, otherwise a file in /tmp will be made returns the path of the tarball """ helper = SandboxCache() self.directory = GetCMSSWRootFromPath(directory) self.tarballPath = helper.generateSandboxFromWorkingDirectory(\ self.directory, target) return self.tarballPath
#!/usr/bin/env python2.6 from optparse import OptionParser from CMSYAAT.FileCache.SandboxCache import SandboxCache # TODO: Get some common options parsing parser = OptionParser() parser.add_option("-w", "--workdir", dest="workdir", help="CMSSW Installation to upload") parser.add_option( "-e", "--endpoint", dest="endpoint", help="Target endpoint", default="https://cmsweb.cern.ch/crabcache" ) (options, args) = parser.parse_args() cache = SandboxCache() cache.generateSandboxFromWorkingDirectory(options.workdir) target = cache.upload() print target