aboutsummaryrefslogtreecommitdiffstats
path: root/test/vcpe/get_info.py
blob: 71efd183c150409695ea9fb8f3b1c5fdb6704595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python

import logging
import json
from vcpecommon import * # pylint: disable=W0614
import argparse

# Run the script with [-h|--help] to get usage info

logging.basicConfig(level=logging.INFO, format='%(message)s')

parser = argparse.ArgumentParser(formatter_class=
                                 argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--config',help='Configuration file path',default=None)
args = parser.parse_args()

vcpecommon = VcpeCommon(cfg_file=args.config)
nodes=['brg', 'bng', 'mux', 'dhcp']
hosts = vcpecommon.get_vm_ip(nodes)
print(json.dumps(hosts, indent=4, sort_keys=True))