Remove unused imports in vcpe python scripts
[integration.git] / test / vcpe / loop.py
1 #!/usr/bin/env python
2
3 import time
4 import logging
5 from vcpecommon import * # pylint: disable=W0614
6 import commands
7 import vcpe_custom_service
8 import argparse
9
10 # Run the script with [-h|--help] to get usage info
11
12 logging.basicConfig(level=logging.INFO, format='%(message)s')
13
14 parser = argparse.ArgumentParser(formatter_class=
15                                  argparse.ArgumentDefaultsHelpFormatter)
16 parser.add_argument('--config',help='Configuration file path',default=None)
17 args = parser.parse_args()
18
19 cpecommon = VcpeCommon(cfg_file=args.config)
20 custom = vcpe_custom_service.CustomService(cpecommon)
21
22 nodes=['mux']
23 hosts = cpecommon.get_vm_ip(nodes)
24
25 custom.del_vgmux_ves_mode(hosts['mux'])
26 time.sleep(2)
27 custom.del_vgmux_ves_collector(hosts['mux'])
28 #exit()
29
30 time.sleep(2)
31 logging.info('Setting vGMUX DCAE collector IP address')
32 custom.set_vgmux_ves_collector(hosts['mux'])
33 time.sleep(2)
34 vgmux_vnf_name = cpecommon.load_object('vgmux_vnf_name')
35 logging.info('vGMUX VNF instance name is %s', vgmux_vnf_name)
36 logging.info('Letting vGMUX report packet loss to DCAE')
37 custom.set_vgmux_packet_loss_rate(hosts['mux'], 55, vgmux_vnf_name)