Bartek Grzybowski | fbbdbec | 2019-09-25 16:37:05 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 2 | |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 3 | import logging |
| 4 | import json |
Bartek Grzybowski | be1067b | 2020-03-04 14:01:02 +0100 | [diff] [blame] | 5 | from vcpecommon import * # pylint: disable=W0614 |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 6 | import argparse |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 7 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 8 | # Run the script with [-h|--help] to get usage info |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 9 | |
| 10 | logging.basicConfig(level=logging.INFO, format='%(message)s') |
| 11 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 12 | parser = argparse.ArgumentParser(formatter_class= |
| 13 | argparse.ArgumentDefaultsHelpFormatter) |
| 14 | parser.add_argument('--config',help='Configuration file path',default=None) |
| 15 | args = parser.parse_args() |
| 16 | |
| 17 | vcpecommon = VcpeCommon(cfg_file=args.config) |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 18 | nodes=['brg', 'bng', 'mux', 'dhcp'] |
| 19 | hosts = vcpecommon.get_vm_ip(nodes) |
| 20 | print(json.dumps(hosts, indent=4, sort_keys=True)) |