Ejemplo n.º 1
0
Archivo: test.py Proyecto: utsdab/usr
def test_blade_ops(blade):
    print "nimby"
    tq.nimby(blade)
    print "unnimby"
    tq.unnimby(blade)
    print "trace"
    trace = tq.trace(blade)
    print trace
    print "eject"
    tq.eject(blade)
    print "delist"
    tq.delist(blade)
Ejemplo n.º 2
0
    def processObject(self, obj):
        """Operate on the provided blade object."""
        # print a header if that is desired
        if not self.opts.noheader:
            hdr = self.formatter.format(obj)
            if self.parent.color:
                hdr = terminal.TerminalColor('yellow').colorStr(hdr)
            print hdr

        trace = query.trace(obj).get((obj.name, obj.ipaddr), "")

        # make each line unique if that is desired
        if self.opts.unique:
            pre  = '[%s] ' % obj.name
            trace = pre + trace.replace('\n', '\n' + pre)
    
        print trace
        obj.post(self, "End of trace.")
Ejemplo n.º 3
0
    def processObject(self, obj):
        """Operate on the provided blade object."""
        # print a header if that is desired
        if not self.opts.noheader:
            hdr = self.formatter.format(obj)
            if self.parent.color:
                hdr = terminal.TerminalColor('yellow').colorStr(hdr)
            print hdr

        trace = query.trace(obj).get((obj.name, obj.ipaddr), "")

        # make each line unique if that is desired
        if self.opts.unique:
            pre = '[%s] ' % obj.name
            trace = pre + trace.replace('\n', '\n' + pre)

        print trace
        obj.post(self, "End of trace.")