Esempio n. 1
0
    def ev_read(self, worker):
        node = worker.current_node
        buf = worker.current_msg
        try:
            data = shine_msg_unpack(buf)

            # COMPAT: Prior to 1.4, 'comp'+'action' was used.
            # 1.4+ uses ActionInfo
            if 'comp' in data:
                action = Action()
                action.NAME = data.pop('action')
                comp = data.pop('comp')
                comp.fs = self.fs
                desc = "%s of %s" % (action.NAME, comp.longtext())
                data['info'] = ActionInfo(action, comp, desc)
                evtype = 'comp'
            else:
                evtype = data.pop('evtype')

            self.fs.distant_event(evtype, node=node, **data)
        except ProxyActionUnpickleError, exp:
            # Maintain a standalone list of unpickling errors.
            # Node could have unpickling error but still exit with 0
            msg = str(exp)
            if msg not in self._errpickle.get(node, ""):
                self._errpickle.add(node, msg)
Esempio n. 2
0
    def ev_read(self, worker):
        node = worker.current_node
        buf = worker.current_msg
        try:
            data = shine_msg_unpack(buf)

            # COMPAT: Prior to 1.4, 'comp'+'action' was used.
            # 1.4+ uses ActionInfo
            if 'comp' in data:
                action = Action()
                action.NAME = data.pop('action')
                comp = data.pop('comp')
                comp.fs = self.fs
                desc = "%s of %s" % (action.NAME, comp.longtext())
                data['info'] = ActionInfo(action, comp, desc)
                evtype = 'comp'
            else:
                evtype = data.pop('evtype')

            self.fs.distant_event(evtype, node=node, **data)
        except ProxyActionUnpickleError as exp:
            # Maintain a standalone list of unpickling errors.
            # Node could have unpickling error but still exit with 0
            msg = str(exp)
            if msg not in self._errpickle.get(node, ""):
                self._errpickle.add(node, msg)
        except AttributeError as exp:
            msg = "Cannot read message (check Shine and ClusterShell " \
                  "version): %s" % str(exp)
            if msg not in self._errpickle.get(node, ""):
                self._errpickle.add(node, msg)
        except ProxyActionUnpackError:
            # Store output that is not a shine message
            self._outputs.add(node, buf)