예제 #1
0
파일: task.py 프로젝트: Vaidyanath/rally
    def __init__(self, task=None, fake=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param fake: if True, will be created task object with random UUID and
            parameters, passed in 'attributes'. Does not create database
            record. Used for special purposes, like task config validation.
        """

        self.fake = fake
        if fake:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
예제 #2
0
파일: task.py 프로젝트: yongfengdu/rally
    def __init__(self, task=None, fake=False, **attributes):
        """Task object init

        :param task: dictionary like object, that represents a task
        :param fake: if True, will be created task object with random UUID and
            parameters, passed in 'attributes'. Does not create database
            record. Used for special purposes, like task config validation.
        """

        self.fake = fake
        if fake:
            self.task = task or {"uuid": str(uuid.uuid4())}
            self.task.update(attributes)
        else:
            self.task = task or db.task_create(attributes)
예제 #3
0
 def _create_task(self, values=None):
     values = values or {}
     if 'deployment_uuid' not in values:
         values['deployment_uuid'] = self.deploy['uuid']
     return db.task_create(values)
예제 #4
0
 def _create_task(self, values=None):
     values = values or {}
     if 'deployment_uuid' not in values:
         values['deployment_uuid'] = self.deploy['uuid']
     return db.task_create(values)
예제 #5
0
 def _create_task(self, values=None):
     values = values or {}
     if "deployment_uuid" not in values:
         values["deployment_uuid"] = self.deploy["uuid"]
     return db.task_create(values)
예제 #6
0
파일: task.py 프로젝트: hughsaunders/rally
 def __init__(self, task=None, **attributes):
     if task:
         self.task = task
     else:
         self.task = db.task_create(attributes)
예제 #7
0
 def __init__(self, task=None, **attributes):
     if task:
         self.task = task
     else:
         self.task = db.task_create(attributes)
예제 #8
0
 def _create_task(self, values=None):
     values = values or {}
     if "deployment_uuid" not in values:
         values["deployment_uuid"] = self.deploy["uuid"]
     return db.task_create(values)
예제 #9
0
 def _create_task(self, values=None):
     return db.task_create(values or {})