Beispiel #1
0
 def _get_plugin(self):
     '''Bind an object to the runtime'''
     try:
         return self.__shared_state["runtime_instance"].get_plugin_for_url(self._url, self._apitype) 
     except Exception, ex:
         error = ("%s %s" % (str(ex), utils.get_traceback()))
         raise bliss.saga.Exception(bliss.saga.Error.NoSuccess, error)
Beispiel #2
0
 def get_service_for_job(self, job_obj):
     '''Return the service object the job is registered with'''
     for key in self.objects.keys():
         if job_obj in self.objects[key]['jobs']:
             return self.objects[key]['instance']
     self.parrent.log_error_and_raise(bliss.saga.Error.NoSuccess, 
       "INTERNAL ERROR: Job object %s is not known by this plugin %s" % (job, utils.get_traceback())) 
Beispiel #3
0
 def _get_plugin(self):
     '''Bind an object to the runtime'''
     try:
         return self.__shared_state["runtime_instance"].get_plugin_for_url(
             self._url, self._apitype)
     except Exception, ex:
         error = ("%s %s" % (str(ex), utils.get_traceback()))
         raise bliss.saga.Exception(bliss.saga.Error.NoSuccess, error)
Beispiel #4
0
 def add_job_object(self, job_obj, service_obj):
     service_id = hex(id(service_obj))  
     job_id = hex(id(job_obj))
     try:
         self.objects[service_id]['jobs'].append(job_obj)
         self.processes[job_id] = LocalJobProcess(jobdescription=job_obj.get_description(), plugin=self.parent)
     except Exception, ex:
         self.parent.log_error_and_raise(bliss.saga.Error.NoSuccess, 
           "Can't register job: %s %s" % (ex, utils.get_traceback()))   
Beispiel #5
0
 def get_process_for_job(self, job_obj):
     '''Return the local process object for a given job'''
     try:
         return self.processes[hex(id(job_obj))]
     except Exception, ex:
         self.parrent.log_error_and_raise(
             bliss.saga.Error.NoSuccess,
             "INTERNAL ERROR: Job object %s is not associated with a process %s"
             % (job_obj, utils.get_traceback()))
Beispiel #6
0
 def get_service_for_job(self, job_obj):
     '''Return the service object the job is registered with'''
     for key in self.objects.keys():
         if job_obj in self.objects[key]['jobs']:
             return self.objects[key]['instance']
     self.parrent.log_error_and_raise(
         bliss.saga.Error.NoSuccess,
         "INTERNAL ERROR: Job object %s is not known by this plugin %s"
         % (job, utils.get_traceback()))
Beispiel #7
0
 def add_job_object(self, job_obj, service_obj):
     service_id = hex(id(service_obj))
     job_id = hex(id(job_obj))
     try:
         self.objects[service_id]['jobs'].append(job_obj)
         self.processes[job_id] = LocalJobProcess(
             jobdescription=job_obj.get_description(),
             plugin=self.parent)
     except Exception, ex:
         self.parent.log_error_and_raise(
             bliss.saga.Error.NoSuccess,
             "Can't register job: %s %s" % (ex, utils.get_traceback()))
Beispiel #8
0
 def log_error_and_raise(self, error, message):
     '''Writes an ERROR to the plugin log and raises an exception'''
     msg = "[%s] %s %s" % (self.name, message, utils.get_traceback())
     self.__logger.error(message)
     raise SAGAException(error, msg)
Beispiel #9
0
 def log_error_and_raise(self, error, message):
     '''Writes an ERROR to the plugin log and raises an exception'''
     msg = "[%s] %s %s" % (self.name, message, utils.get_traceback())
     self.__logger.error(message)
     raise SAGAException(error, msg)
Beispiel #10
0
 def get_process_for_job(self, job_obj):
     '''Return the local process object for a given job'''
     try: 
         return self.processes[hex(id(job_obj))]
     except Exception, ex:
         self.parrent.log_error_and_raise(bliss.saga.Error.NoSuccess, 
         "INTERNAL ERROR: Job object %s is not associated with a process %s" % (job_obj, utils.get_traceback()))