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 | |
| 3 | import time |
| 4 | import logging |
| 5 | import json |
| 6 | import mysql.connector |
| 7 | import ipaddress |
| 8 | import re |
| 9 | import sys |
| 10 | import base64 |
| 11 | from vcpecommon import * |
| 12 | import preload |
| 13 | import vcpe_custom_service |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 14 | import argparse |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 15 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 16 | # Run the script with [-h|--help] to get usage info |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 17 | |
| 18 | logging.basicConfig(level=logging.INFO, format='%(message)s') |
| 19 | |
Bartek Grzybowski | 01abb5d | 2019-12-17 15:09:26 +0100 | [diff] [blame] | 20 | parser = argparse.ArgumentParser(formatter_class= |
| 21 | argparse.ArgumentDefaultsHelpFormatter) |
| 22 | parser.add_argument('--config',help='Configuration file path',default=None) |
| 23 | args = parser.parse_args() |
| 24 | |
| 25 | vcpecommon = VcpeCommon(cfg_file=args.config) |
Kang Xi | 11d278c | 2018-04-06 16:56:04 -0400 | [diff] [blame] | 26 | nodes=['brg', 'bng', 'mux', 'dhcp'] |
| 27 | hosts = vcpecommon.get_vm_ip(nodes) |
| 28 | print(json.dumps(hosts, indent=4, sort_keys=True)) |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |