summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/vcpeutils/preload.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-05-04 15:51:36 -0400
committerDR695H <dr695h@att.com>2019-05-04 16:33:51 -0400
commit158df8f73cb2988031cd408939681d3ade443b2f (patch)
treeaaa0faca916a105adef1eb734d3e7dd528cfb7a3 /robotframework-onap/vcpeutils/preload.py
parent8ad85420e45ffeafb536de55b31ad68c0d03c986 (diff)
fix vcpeutils
removed relative imports and using the preferred method of importing. use the open instead of file method to get files use the new pyaml method that specifies the loader use builtins.basestring for unicode and nonunicode comparison use the correct method to call the robot framework logger warn adding in unit tests for things to make sure they work Change-Id: I15da74ff66988ef2610ada3ae21a1c6104c26c35 Issue-ID: INT-1061 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robotframework-onap/vcpeutils/preload.py')
-rwxr-xr-xrobotframework-onap/vcpeutils/preload.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/robotframework-onap/vcpeutils/preload.py b/robotframework-onap/vcpeutils/preload.py
index 6ccc689..642b5e7 100755
--- a/robotframework-onap/vcpeutils/preload.py
+++ b/robotframework-onap/vcpeutils/preload.py
@@ -1,15 +1,15 @@
#! /usr/bin/python
from datetime import datetime
-from .vcpecommon import *
-from .csar_parser import *
+from vcpeutils.vcpecommon import *
+from vcpeutils.csar_parser import *
from robot.api import logger
+from past import builtins
import base64
class Preload:
def __init__(self, vcpecommon):
- #self.logger = logging.getLogger(__name__)
self.logger = logger
self.vcpecommon = vcpecommon
@@ -31,11 +31,11 @@ class Preload:
stk.append(v)
elif type(v) is list:
stk.extend(v)
- elif type(v) is str or type(v) is str:
+ elif type(v) is builtins.basestring:
if self.vcpecommon.template_variable_symbol in v:
data[k] = self.replace(v, replace_dict)
else:
- self.logger.warning('Unexpected line in template: %s. Look for value %s', template_file, v)
+ self.logger.warn('Unexpected line in template: {}. Look for value {}'.format(template_file, v))
return json_data
def reset_sniro(self):
@@ -83,6 +83,7 @@ class Preload:
:param network_role: cpe_signal, cpe_public, brg_bng, bng_mux, mux_gw
:param subnet_start_ip:
:param subnet_gateway:
+ :param common_dict:
:param name_suffix: e.g. '201711201311'
:return:
"""
@@ -184,7 +185,7 @@ class Preload:
print('---------------------------------------------------------------')
print('Network related replacement dictionary:')
- print((json.dumps(network_dict, indent=4, sort_keys=True)))
+ print(json.dumps(network_dict, indent=4, sort_keys=True))
print('---------------------------------------------------------------')
keys = ['infra', 'bng', 'gmux', 'brg']