示例#1
0
    def __init__(self,
                 project_config,
                 task_config,
                 org_config=None,
                 flow=None,
                 **kwargs):
        self.project_config = project_config
        self.task_config = task_config
        self.org_config = org_config
        self.poll_count = 0
        self.poll_interval_level = 0
        self.poll_interval_s = 1
        self.poll_complete = False

        # dict of return_values that can be used by task callers
        self.return_values = {}

        # simple result object for introspection, often a return_code
        self.result = None

        # the flow for this task execution
        self.flow = flow

        if self.salesforce_task and not self.org_config:
            raise TaskRequiresSalesforceOrg(
                'This task requires a Saleforce org_config but' +
                ' none was passed to the Task constructor')
        self._init_logger()
        self._init_options(kwargs)
        self._validate_options()
        self._update_credentials()
        self._init_task()
示例#2
0
 def __init__(self, project_config, task_config, org_config=None, **kwargs):
     self.project_config = project_config
     self.task_config = task_config
     self.org_config = org_config
     if self.salesforce_task and not self.org_config:
         raise TaskRequiresSalesforceOrg(
             'This task requires a Saleforce org_config but none was passed to __init__'
         )
     self._init_logger()
     self._init_options(kwargs)
     self._validate_options()
     self._update_credentials()
     self._init_task()
示例#3
0
    def __call__(self):
        if self.salesforce_task and not self.org_config:
            raise TaskRequiresSalesforceOrg(
                "This task requires a salesforce org. "
                "Use org default <name> to set a default org "
                "or pass the org name with the --org option")
        self._update_credentials()
        self._init_task()

        with stacked_task(self):
            self.working_path = os.getcwd()
            with cd(self.project_config.repo_root):
                self._log_begin()
                self.result = self._run_task()
                return self.return_values
示例#4
0
    def __init__(
        self,
        project_config,
        task_config,
        org_config=None,
        flow=None,
        name=None,
        stepnum=None,
        **kwargs
    ):
        self.project_config = project_config
        self.task_config = task_config
        self.org_config = org_config
        self.poll_count = 0
        self.poll_interval_level = 0
        self.poll_interval_s = 1
        self.poll_complete = False

        # dict of return_values that can be used by task callers
        self.return_values = {}

        # simple result object for introspection, often a return_code
        self.result = None

        # the flow for this task execution
        self.flow = flow

        # the tasks name in the flow
        self.name = name

        # the tasks stepnumber in the flow
        self.stepnum = stepnum

        if self.salesforce_task and not self.org_config:
            raise TaskRequiresSalesforceOrg(
                "This task requires a salesforce org. "
                "Use org default <name> to set a default org "
                "or pass the org name with the --org option"
            )
        self._init_logger()
        self._init_options(kwargs)
        self._validate_options()
        self._update_credentials()
        self._init_task()
示例#5
0
    def __call__(self):
        # If sentry is configured, initialize sentry for error capture
        self.project_config.init_sentry()

        if self.salesforce_task and not self.org_config:
            raise TaskRequiresSalesforceOrg(
                "This task requires a salesforce org. "
                "Use org default <name> to set a default org "
                "or pass the org name with the --org option")
        self._update_credentials()
        self._init_task()

        with stacked_task(self):
            try:
                self._log_begin()
                self.result = self._run_task()
                return self.return_values
            except Exception as e:
                self._process_exception(e)
                raise
示例#6
0
 def __init__(self, project_config, task_config,
              org_config=None, flow=None, **kwargs):
     self.project_config = project_config
     self.task_config = task_config
     self.org_config = org_config
     self.return_values = {}
     """ a dict of return_values that can be used by task callers """
     self.result = None
     """ a simple result object for introspection, often a return_code """
     self.flow = flow
     """ The flow for this task execution """
     if self.salesforce_task and not self.org_config:
         raise TaskRequiresSalesforceOrg('This task requires a Saleforce '
                                         'org_config but none was passed '
                                         'to the Task constructor')
     self._init_logger()
     self._init_options(kwargs)
     self._validate_options()
     self._update_credentials()
     self._init_task()