Пример #1
0
Файл: vrf.py Проект: yakirl/ryu
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     ret = cls._format_family_header()
     for family, data in resp.value.items():
         ret += 'VPN: {0}\n'.format(family)
         ret += cls._format_family(data)
     return ret
Пример #2
0
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     ret = cls._format_family_header()
     for family, data in resp.value.iteritems():
         ret += 'VPN: {0}\n'.format(family)
         ret += cls._format_family(data)
     return ret
Пример #3
0
        def cli_resp_formatter(cls, resp):
            if resp.status == STATUS_ERROR:
                return Command.cli_resp_formatter(resp)
            val = resp.value
            ret = 'Unreachable objects: {0}\n'.format(
                val.get('unreachable', None))
            ret += 'Total memory used (MB): {0}\n'.format(
                val.get('total', None))
            ret += 'Classes with instances that take-up more than one MB:\n'
            ret += '{0:<20s} {1:>16s} {2:>16s}\n'.format(
                'Class', '#Instance', 'Size(MB)')

            for s in val.get('summary', []):
                ret += '{0:<20s} {1:>16d} {2:>16d}\n'.format(
                    s.get('class', None), s.get('instances', None),
                    s.get('size', None))

            return ret
Пример #4
0
        def cli_resp_formatter(cls, resp):
            if resp.status == STATUS_ERROR:
                return Command.cli_resp_formatter(resp)
            val = resp.value
            ret = 'Unreachable objects: {0}\n'.format(
                val.get('unreachable', None)
            )
            ret += 'Total memory used (MB): {0}\n'.format(
                val.get('total', None)
            )
            ret += 'Classes with instances that take-up more than one MB:\n'
            ret += '{0:<20s} {1:>16s} {2:>16s}\n'.format(
                'Class',
                '#Instance',
                'Size(MB)'
            )

            for s in val.get('summary', []):
                ret += '{0:<20s} {1:>16d} {2:>16d}\n'.format(
                    s.get('class', None), s.get('instances', None),
                    s.get('size', None)
                )

            return ret
Пример #5
0
Файл: vrf.py Проект: yakirl/ryu
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     return pprint.pformat(resp.value)
Пример #6
0
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     return cls._format_header() + cls._format_value(resp.value)
Пример #7
0
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     return cls._format_header() + cls._format_value(resp.value)
Пример #8
0
 def cli_resp_formatter(cls, resp):
     if resp.status == STATUS_ERROR:
         return Command.cli_resp_formatter(resp)
     return pprint.pformat(resp.value)