Update ping pong config scripts to support Python 3.3 (FC20)
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
diff --git a/examples/ping_pong_ns/rift/mano/examples/ping_rate.py b/examples/ping_pong_ns/rift/mano/examples/ping_rate.py
index b3ab07b..0892aa6 100755
--- a/examples/ping_pong_ns/rift/mano/examples/ping_rate.py
+++ b/examples/ping_pong_ns/rift/mano/examples/ping_rate.py
@@ -50,9 +50,11 @@
rate=rate)
logger.debug("Executing cmd: %s", cmd)
- proc = subprocess.run(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+ proc.wait()
logger.debug("Process: {}".format(proc))
diff --git a/examples/ping_pong_ns/rift/mano/examples/ping_setup.py b/examples/ping_pong_ns/rift/mano/examples/ping_setup.py
index c05e669..c0d0589 100755
--- a/examples/ping_pong_ns/rift/mano/examples/ping_setup.py
+++ b/examples/ping_pong_ns/rift/mano/examples/ping_setup.py
@@ -62,15 +62,16 @@
while True:
count += 1
- proc = subprocess.run(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.wait()
logger.debug("Process: {}".format(proc))
if proc.returncode == 0:
# Check if response is 200 OK
- resp = proc.stdout.decode()
+ resp = proc.stdout.read().decode()
if 'HTTP/1.1 200 OK' in resp:
rc = 0
break
diff --git a/examples/ping_pong_ns/rift/mano/examples/ping_start_stop.py b/examples/ping_pong_ns/rift/mano/examples/ping_start_stop.py
index 76f653c..fdd62ed 100755
--- a/examples/ping_pong_ns/rift/mano/examples/ping_start_stop.py
+++ b/examples/ping_pong_ns/rift/mano/examples/ping_start_stop.py
@@ -51,17 +51,18 @@
start=start)
logger.debug("Executing cmd: %s", cmd)
- proc = subprocess.run(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.wait()
logger.debug("Process: {}".format(proc))
rc = proc.returncode
if rc == 0:
# Check if we got 200 OK
- resp = proc.stdout.decode()
+ resp = proc.stdout.read().decode()
if 'HTTP/1.1 200 OK' not in resp:
self._log.error("Got error response: {}".format(resp))
rc = 1
diff --git a/examples/ping_pong_ns/rift/mano/examples/pong_setup.py b/examples/ping_pong_ns/rift/mano/examples/pong_setup.py
index cd56eca..7bd2479 100755
--- a/examples/ping_pong_ns/rift/mano/examples/pong_setup.py
+++ b/examples/ping_pong_ns/rift/mano/examples/pong_setup.py
@@ -62,15 +62,16 @@
while True:
count += 1
- proc = subprocess.run(config_cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(config_cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.wait()
logger.debug("Process: {}".format(proc))
if proc.returncode == 0:
# Check if response is 200 OK
- resp = proc.stdout.decode()
+ resp = proc.stdout.read().decode()
if 'HTTP/1.1 200 OK' in resp:
rc = 0
break
diff --git a/examples/ping_pong_ns/rift/mano/examples/pong_start_stop.py b/examples/ping_pong_ns/rift/mano/examples/pong_start_stop.py
index b5195dd..30e7fa6 100755
--- a/examples/ping_pong_ns/rift/mano/examples/pong_start_stop.py
+++ b/examples/ping_pong_ns/rift/mano/examples/pong_start_stop.py
@@ -51,17 +51,18 @@
start=start)
logger.debug("Executing cmd: %s", cmd)
- proc = subprocess.run(cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.wait()
logger.debug("Process: {}".format(proc))
rc = proc.returncode
if rc == 0:
# Check if we got 200 OK
- resp = proc.stdout.decode()
+ resp = proc.stdout.read().decode()
if 'HTTP/1.1 200 OK' not in resp:
self._log.error("Got error response: {}".format(resp))
rc = 1
diff --git a/examples/ping_pong_ns/rift/mano/examples/start_traffic.py b/examples/ping_pong_ns/rift/mano/examples/start_traffic.py
index 3093792..2f89c56 100755
--- a/examples/ping_pong_ns/rift/mano/examples/start_traffic.py
+++ b/examples/ping_pong_ns/rift/mano/examples/start_traffic.py
@@ -41,10 +41,11 @@
vnf_type=vnf_type)
logger.debug("Executing cmd: %s", curl_cmd)
- proc = subprocess.run(curl_cmd, shell=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ proc = subprocess.Popen(curl_cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ proc.wait()
logger.debug("Process: {}".format(proc))
return proc.returncode