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
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
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
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
def cli_resp_formatter(cls, resp): if resp.status == STATUS_ERROR: return Command.cli_resp_formatter(resp) return pprint.pformat(resp.value)
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)