Exemplo n.º 1
0
    def __init__(self,
                 error='',
                 command_stdout=None,
                 command_stderr=None,
                 command_exit_status=None,
                 **kwargs):
        """ 
        Class constructor. 

        :param error: Error message.
        :type error: str

        :param command_stdout: Command standard output.
        :type command_stdout: str

        :param command_stderr: Command standard error.
        :type command_stderr: str

        :param command_exit_status: Command exit status.
        :type command_exit_status: int

        :param kwargs: Keyword arguments, may contain 'args=error_message', 'exception=exception_object', or 'error_details=details'.
        """
        QconfException.__init__(self, error, uge_status.UGE_COMMAND_FAILED,
                                **kwargs)
        self.command_stdout = command_stdout
        self.command_stderr = command_stderr
        self.command_exit_status = command_exit_status
Exemplo n.º 2
0
    def __init__(self, error='', **kwargs):
        """ 
        Class constructor. 

        :param error: Error message.
        :type error: str

        :param kwargs: Keyword arguments, may contain 'args=error_message', 'exception=exception_object', or 'error_details=details'.
        """
        QconfException.__init__(self, error, uge_status.UGE_INVALID_ARGUMENT,
                                **kwargs)
Exemplo n.º 3
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
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)