Example #1
0
File: executor.py Project: tml/norc
 def start_instance(self, instance):
     """Starts a given instance in a new process."""
     instance.executor = self
     instance.save()
     self.log.info("Starting instance '%s'..." % instance)
     # p = Process(target=self.execute, args=[instance.start])
     # p.start()
     ct = ContentType.objects.get_for_model(instance)
     p = Popen('norc_taskrunner --ct_pk %s --target_pk %s' %
         (ct.pk, instance.pk), shell=True)
     p.instance = instance
     self.processes[p.pid] = p
Example #2
0
 def start_instance(self, instance):
     """Starts a given instance in a new process."""
     instance.executor = self
     instance.save()
     self.log.info("Starting %s..." % instance)
     # p = Process(target=self.execute, args=[instance.start])
     # p.start()
     ct = ContentType.objects.get_for_model(instance)
     f = make_log(instance.log_path).file
     p = Popen('norc_taskrunner --ct_pk %s --target_pk %s' %
               (ct.pk, instance.pk),
               stdout=f,
               stderr=STDOUT,
               shell=True)
     p.instance = instance
     self.processes[p.pid] = p