示例#1
0
    def pre_run(self):
        chainspec_file = self.entry_point
        LOG.debug('Reading action chain from %s for action %s.',
                  chainspec_file, self.action)

        try:
            chainspec = self._meta_loader.load(file_path=chainspec_file,
                                               expected_type=dict)
        except Exception as e:
            message = (
                'Failed to parse action chain definition from "%s": %s' %
                (chainspec_file, str(e)))
            LOG.exception('Failed to load action chain definition.')
            raise runnerexceptions.ActionRunnerPreRunError(message)

        try:
            self.chain_holder = ChainHolder(chainspec, self.action_name)
        except Exception as e:
            message = e.message or str(e)
            LOG.exception('Failed to instantiate ActionChain.')
            raise runnerexceptions.ActionRunnerPreRunError(message)

        # Runner attributes are set lazily. So these steps
        # should happen outside the constructor.
        if getattr(self, 'liveaction', None):
            self._chain_notify = getattr(self.liveaction, 'notify', None)
        if self.runner_parameters:
            self._skip_notify_tasks = self.runner_parameters.get(
                'skip_notify', [])
示例#2
0
    def pre_run(self):
        super(ActionChainRunner, self).pre_run()

        chainspec_file = self.entry_point
        LOG.debug("Reading action chain from %s for action %s.",
                  chainspec_file, self.action)

        try:
            chainspec = self._meta_loader.load(file_path=chainspec_file,
                                               expected_type=dict)
        except Exception as e:
            message = 'Failed to parse action chain definition from "%s": %s' % (
                chainspec_file,
                six.text_type(e),
            )
            LOG.exception("Failed to load action chain definition.")
            raise runner_exc.ActionRunnerPreRunError(message)

        try:
            self.chain_holder = ChainHolder(chainspec, self.action_name)
        except json_schema_exc.ValidationError as e:
            # preserve the whole nasty jsonschema message as that is better to get to the
            # root cause
            message = six.text_type(e)
            LOG.exception("Failed to instantiate ActionChain.")
            raise runner_exc.ActionRunnerPreRunError(message)
        except Exception as e:
            message = six.text_type(e)
            LOG.exception("Failed to instantiate ActionChain.")
            raise runner_exc.ActionRunnerPreRunError(message)

        # Runner attributes are set lazily. So these steps
        # should happen outside the constructor.
        if getattr(self, "liveaction", None):
            self._chain_notify = getattr(self.liveaction, "notify", None)
        if self.runner_parameters:
            self._skip_notify_tasks = self.runner_parameters.get(
                "skip_notify", [])
            self._display_published = self.runner_parameters.get(
                "display_published", True)

        # Perform some pre-run chain validation
        try:
            self.chain_holder.validate()
        except Exception as e:
            raise runner_exc.ActionRunnerPreRunError(six.text_type(e))
示例#3
0
 def pre_run(self):
     chainspec_file = self.entry_point
     LOG.debug('Reading action chain from %s for action %s.',
               chainspec_file, self.action)
     try:
         chainspec = self._meta_loader.load(chainspec_file)
         self.action_chain = ActionChain(chainspec)
     except Exception as e:
         LOG.exception('Failed to instantiate ActionChain.')
         raise runnerexceptions.ActionRunnerPreRunError(e.message)
示例#4
0
 def pre_run(self):
     chainspec_file = self.entry_point
     LOG.debug('Reading action chain from %s for action %s.',
               chainspec_file, self.action)
     try:
         chainspec = self._meta_loader.load(chainspec_file)
         self.chain_holder = ChainHolder(chainspec, self.action_name)
     except Exception as e:
         message = e.message or str(e)
         LOG.exception('Failed to instantiate ActionChain.')
         raise runnerexceptions.ActionRunnerPreRunError(message)
    def pre_run(self):
        super(AnnouncementRunner, self).pre_run()

        LOG.debug('Entering AnnouncementRunner.pre_run() for liveaction_id="%s"',
                  self.liveaction_id)

        if not self.runner_parameters.get('experimental'):
            message = ('Experimental flag is missing for action %s' % self.action.ref)
            LOG.exception('Experimental runner is called without experimental flag.')
            raise runnerexceptions.ActionRunnerPreRunError(message)

        self._route = self.runner_parameters.get('route')
示例#6
0
    def pre_run(self):
        chainspec_file = self.entry_point
        LOG.debug('Reading action chain from %s for action %s.',
                  chainspec_file, self.action)

        try:
            chainspec = self._meta_loader.load(file_path=chainspec_file,
                                               expected_type=dict)
        except Exception as e:
            message = (
                'Failed to parse action chain definition from "%s": %s' %
                (chainspec_file, str(e)))
            LOG.exception('Failed to load action chain definition.')
            raise runnerexceptions.ActionRunnerPreRunError(message)

        try:
            self.chain_holder = ChainHolder(chainspec, self.action_name)
        except Exception as e:
            message = e.message or str(e)
            LOG.exception('Failed to instantiate ActionChain.')
            raise runnerexceptions.ActionRunnerPreRunError(message)