Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 6
0
 def __init__(self, task=None, **attributes):
     if task:
         self.task = task
     else:
         self.task = db.task_create(attributes)
Esempio n. 7
0
 def __init__(self, task=None, **attributes):
     if task:
         self.task = task
     else:
         self.task = db.task_create(attributes)
Esempio n. 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)
Esempio n. 9
0
 def _create_task(self, values=None):
     return db.task_create(values or {})