def impl(request): seutils.debug() fi = get_fake_internet() seutils.logger.debug('Setup; test nodes: %s', fi.fs['root://foo.bar.gov'].nodes) fakefs.activate_command_interception(fi) yield request.getfixturevalue(request.param) fakefs.deactivate_command_interception()
def remotefs(): seutils.debug() fs = fakefs.FakeRemoteFS('root://foo.bar.gov/') fs.put('root://foo.bar.gov//foo/bar/test.file', isdir=False, content='testcontent') seutils.logger.info('End of setup; fs: %s', fs.nodes) return fs
def parse_args(self, *args, **kwargs): parsed_args = self.parser.parse_args(*args, **kwargs) if parsed_args.verbose: seutils.debug() if self.use_implementation: parsed_args.implementation = root.get_implementation( parsed_args.implementation) else: parsed_args.implementation = None return parsed_args
def fake_internet(): seutils.debug() fi = fakefs.FakeInternet() fs_local = fakefs.FakeFS() fs_remote = fakefs.FakeRemoteFS('root://foo.bar.gov') fs_local.put('/foo/bar/local.file', isdir=False, content='localcontent') fs_remote.put('/foo/bar/test.file', isdir=False, content='testcontent') fi.fs = {fs_remote.mgm: fs_remote, '<local>': fs_local} fakefs.activate_command_interception(fi) yield fi fakefs.deactivate_command_interception()
def activate_fake_internet(): seutils.debug() seutils.logger.debug('Setting up fake internet') fi = fakefs.FakeInternet() fs = fakefs.FakeRemoteFS('root://cmseos.fnal.gov') fs.put('/store/user/klijnsma', isdir=True) fs_local = fakefs.FakeFS() fs_local.put(osp.join(os.getcwd(), 'seutils_tmpfile'), isdir=False, content='testcontent') fi.fs = {'root://cmseos.fnal.gov': fs, '<local>': fs_local} seutils.logger.debug('Setup; test nodes: %s', fi.fs['root://cmseos.fnal.gov'].nodes) fakefs.activate_command_interception(fi)
#$ ls(root://cmseos.fnal.gov//store/user/lpcsusyhad/SVJ2017/boosted/gen/nohtcut_Aug04_mz250/*.root) #$ endset #$ set #$ mz 450 #$ items b=2 \ #$ ls(root://cmseos.fnal.gov//store/user/lpcsusyhad/SVJ2017/boosted/gen/nohtcut_Aug04_mz450/*.root) #$ endset #$ set #$ mz 650 #$ items b=2 \ #$ ls(root://cmseos.fnal.gov//store/user/lpcsusyhad/SVJ2017/boosted/gen/nohtcut_Aug04_mz650/*.root) #$ endset import os.path as osp, argparse, re import qondor, seutils, svjqondor, uuid seutils.debug() cmssw = qondor.init_cmssw() mz = int(qondor.get_var('mz')) max_events = 10000 # runSVJ wants maxEvents to be passed, just set it large enough physics = { 'year': 2018, 'mz': mz, 'mdark': 20., 'rinv': 0.3, 'boost': 0., } part = qondor.get_proc_id() + 1 for i_rootfile, rootfile in enumerate(qondor.get_item()):