示例#1
0
    def __init__(self, *args, **kwargs):
        WatcherBase.__init__(self, *args, **kwargs)

        self._vm_manager = master.lib.vm.manage.VMManager(on_worker_exited=self._on_worker_exited)

        for img in master.models.Image.objects(status__name__in=["import", "configure", "create", "delete"]):
            self._handle_status(img.id, image=img)
示例#2
0
文件: result.py 项目: asdyxcyxc/talus
    def __init__(self, *args, **kwargs):
        WatcherBase.__init__(self, *args, **kwargs)

        self._processors = []

        for filename in glob.glob(
                os.path.join(os.path.dirname(__file__), "result_processors",
                             "*.py")):
            filename_ = os.path.basename(filename)
            if filename_ == "__init__.py":
                continue
            mod_name = filename_.replace(".py", "")
            mod = __import__("master.watchers.result_processors",
                             globals(),
                             locals(),
                             fromlist=[mod_name])
            mod = getattr(mod, mod_name)
            for item_name in dir(mod):
                item = getattr(mod, item_name)
                # we only care about classes
                if type(item) is not type:
                    continue
                if issubclass(item, ResultProcessorBase):
                    self._log.info("found result processor: {}".format(
                        item.__name__))
                    self._processors.append(item())
示例#3
0
文件: job.py 项目: CylanceSPEAR/talus
	def __init__(self, *args, **kwargs):
		WatcherBase.__init__(self, *args, **kwargs)

		self._job_man = JobManager()
		# this needs to be continuously running
		self._job_man.start()

		for job in master.models.Job.objects(status__name__in=["run", "stop", "cancel"]):
			self._handle_status(job.id, job=job)
示例#4
0
    def __init__(self, *args, **kwargs):
        WatcherBase.__init__(self, *args, **kwargs)

        self._job_man = JobManager()
        # this needs to be continuously running
        self._job_man.start()

        for job in master.models.Job.objects(
                status__name__in=["run", "stop", "cancel"]):
            self._handle_status(job.id, job=job)
示例#5
0
    def __init__(self, *args, **kwargs):
        WatcherBase.__init__(self, *args, **kwargs)

        self._processors = []

        for filename in glob.glob(os.path.join(os.path.dirname(__file__), "result_processors", "*.py")):
            filename_ = os.path.basename(filename)
            if filename_ == "__init__.py":
                continue
            mod_name = filename_.replace(".py", "")
            mod = __import__("master.watchers.result_processors", globals(), locals(), fromlist=[mod_name])
            mod = getattr(mod, mod_name)
            for item_name in dir(mod):
                item = getattr(mod, item_name)
                # we only care about classes
                if type(item) is not type:
                    continue
                if issubclass(item, ResultProcessorBase):
                    self._log.info("found result processor: {}".format(item.__name__))
                    self._processors.append(item())
示例#6
0
    def __init__(self, *args, **kwargs):
        WatcherBase.__init__(self, *args, **kwargs)

        for code in master.models.Code.objects(
                type__in=["new_tool", "new_component"]):
            self._handle_new_code(code.id, code=code)
示例#7
0
	def __init__(self, *args, **kwargs):
		WatcherBase.__init__(self, *args, **kwargs)

		for code in master.models.Code.objects(type__in=["new_tool", "new_component"]):
			self._handle_new_code(code.id, code=code)