Пример #1
0
 def __input_files_from_dataset(self, dataset):
     datasets = self.__get_datasets()
     if not dataset in datasets:
         msg = 'Cannot find dataset {0}'.format(dataset)
         LOG.error(msg)
         import sys
         sys.exit(msg)
     path = [os.path.join(p, '*/*.root') for p in datasets[dataset]]
     return ParentCommand.input_files_from_path(path)
Пример #2
0
 def __add_input_files(self):
     input_files = []
     path = self.__variables['files']
     dataset = self.__variables['dataset']
     if path != '':
         input_files = ParentCommand.input_files_from_path(path)
     else:
         input_files = self.__input_files_from_dataset(dataset)
     self.__variables['input_files'] = input_files
Пример #3
0
 def testTarFilesInInputFiles(self):
     c1 = RunCommand()
     c1._create_tar_file([], {})
     existing_files = TarCommand.get_existing_files()
     for f in existing_files:
         self.assertTrue(f in c1.get_input_files())
     c2 = RunCommand()
     # this should not create a second tar file
     # since a "fresh" one exists
     c2._create_tar_file([], {})
     existing_files = TarCommand.get_existing_files()
     for f in existing_files:
         self.assertTrue(f in c2.get_input_files())
Пример #4
0
 def __add_input_files(self):
     input_files = []
     path = self.__variables['files']
     dataset = self.__variables['dataset']
     campaign = self.__variables['campaign']
     if path != '':
         input_files = ParentCommand.input_files_from_path(path)
         # dress them for CMSSW (unless they have a global path)
         input_files = ['file://{0}'.format(f) if not f.startswith('/store') else f for f in input_files]
     else:
         input_files = find_input_files(
             campaign, dataset, self.__variables, LOG
         )
     self.__variables['input_files'] = input_files
Пример #5
0
 def __add_input_files(self):
     input_files = []
     path = self.__variables['files']
     dataset = self.__variables['dataset']
     campaign = self.__variables['campaign']
     if path != '':
         input_files = ParentCommand.input_files_from_path(path)
         # dress them for CMSSW (unless they have a global path)
         input_files = [
             'file://{0}'.format(f) if not f.startswith('/store') else f
             for f in input_files
         ]
     else:
         input_files = find_input_files(campaign, dataset, self.__variables,
                                        LOG)
     self.__variables['input_files'] = input_files
Пример #6
0
    def testCreateTar(self):
        c1 = RunCommand()
        c1._create_tar_file([], {})
        existing_files = TarCommand.get_existing_files()
        self.assertTrue(len(existing_files) > 0)

        if not existing_files:
            return

        mtime1 = os.path.getmtime(existing_files[0])

        c2 = RunCommand()
        # this should not create a second tar file
        # since a "fresh" one exists
        c2._create_tar_file([], {})
        existing_files = TarCommand.get_existing_files()
        mtime2 = os.path.getmtime(existing_files[0])
        self.assertEqual(mtime1, mtime2)