From 8ec08166dc4aa24bf4bd1c514ec845f64e34f2d5 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Wed, 6 May 2020 04:42:18 -0700 Subject: Drop superfluous variables and type casts Change-Id: Ic8e9eab90c537584b2c771bdeb59c0b43deb992e Issue-ID: INT-1577 Signed-off-by: Bartek Grzybowski --- test/mocks/mass-pnf-sim/mass-pnf-sim.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/mocks/mass-pnf-sim/mass-pnf-sim.py b/test/mocks/mass-pnf-sim/mass-pnf-sim.py index db567ede0..655b87ccc 100755 --- a/test/mocks/mass-pnf-sim/mass-pnf-sim.py +++ b/test/mocks/mass-pnf-sim/mass-pnf-sim.py @@ -62,11 +62,11 @@ logger.setLevel(getattr(logging, args.verbose.upper())) if args.bootstrap and args.ipstart and args.urlves: logger.info("Bootstrap:") - start_port=2000 - ftps_pasv_port_start=8000 - ftps_pasv_port_num_of_ports=10 + start_port = 2000 + ftps_pasv_port_start = 8000 + ftps_pasv_port_num_of_ports = 10 - ftps_pasv_port_end=ftps_pasv_port_start + ftps_pasv_port_num_of_ports + ftps_pasv_port_end = ftps_pasv_port_start + ftps_pasv_port_num_of_ports for i in range(args.bootstrap): logger.info("PNF simulator instance: " + str(i) + ".") @@ -82,12 +82,9 @@ if args.bootstrap and args.ipstart and args.urlves: IpPnfSim = args.ipstart + int(2 + (i * 16)) logger.debug("\tIp Pnf SIM:" + str(IpPnfSim)) - IpFileServer = str(args.ipfileserver) - TypeFileServer = args.typefileserver - - PortSftp=start_port +1 - PortFtps=start_port +2 - start_port +=2 + PortSftp = start_port + 1 + PortFtps = start_port + 2 + start_port += 2 UrlFtps = str(args.ipstart + int(3 + (i * 16))) logger.debug("\tUrl Ftps: " + str(UrlFtps)) @@ -109,8 +106,8 @@ if args.bootstrap and args.ipstart and args.urlves: str(i) + " " + \ args.urlves + " " + \ str(IpPnfSim) + " " + \ - IpFileServer + " " + \ - TypeFileServer + " " + \ + str(args.ipfileserver) + " " + \ + args.typefileserver + " " + \ str(PortSftp) + " " + \ str(PortFtps) + " " + \ str(UrlFtps) + " " + \ @@ -127,7 +124,7 @@ if args.bootstrap and args.ipstart and args.urlves: logger.info(f'Cloning: {completed.stdout}') ftps_pasv_port_start += ftps_pasv_port_num_of_ports + 1 - ftps_pasv_port_end += ftps_pasv_port_num_of_ports +1 + ftps_pasv_port_end += ftps_pasv_port_num_of_ports + 1 completed = subprocess.run('set -x; cd pnf-sim-lightweight; ./simulator.sh build ', shell=True) logger.info(f"Build docker image: {completed.stdout}") -- cgit 1.2.3-korg