def __get_object_class_from_uge_version(cls, uge_version, class_name, base_module_name=None):
     if not uge_version:
         raise InvalidRequest('Cannot generate %s object: UGE version must be specified.' % class_name)
     if uge_version not in UGE_RELEASE_OBJECT_MAP:
         raise QconfException('Unsupported UGE version: %s.' % uge_version)
     release_map = UGE_RELEASE_OBJECT_MAP.get(uge_version)
     object_version = release_map.get(class_name)
     return cls.__get_object_class_from_object_version(object_version, class_name, base_module_name)
Exemple #2
0
 def get_uge_version(self):
     if not self.uge_version:
         p = self.execute_qconf('-help')
         lines = p.get_stdout().split('\n')
         if not len(lines):
             raise QconfException('Cannot determine UGE version from output: %s' % p.get_stdout())
         self.uge_version = lines[0].split()[-1]
     return self.uge_version
 def execute_qconf_with_dir(self, cmd, dir, error_regex_list=[]):
     if not os.path.isdir(dir):
         raise QconfException('%s is not a directory' % dir)
     full_cmd = '%s %s' % (cmd, dir)
     self.execute_qconf(full_cmd, error_regex_list=error_regex_list)