X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FQemuUtils.py;h=2b08429d840b0afad8051fe143b8d12f19293356;hb=ebe8b93eff2b7860ee2a506b18661aa2c1930390;hp=09c3df77256e0122943d37a53451763c61d7551a;hpb=ae652334356c12b167399a340ad55abd1ef7bbce;p=csit.git diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index 09c3df7725..2b08429d84 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -236,7 +236,7 @@ class QemuUtils: template = f"{Constants.RESOURCES_TPL_VM}/{self._opt.get(u'vnf')}.exec" exec_cmd_no_error(self._node, f"rm -f {running}", sudo=True) - with open(template, "r") as src_file: + with open(template, u"rt") as src_file: src = Template(src_file.read()) exec_cmd_no_error( self._node, f"echo '{src.safe_substitute(**kwargs)}' | " @@ -296,7 +296,7 @@ class QemuUtils: init = self._temp.get(u"ini") exec_cmd_no_error(self._node, f"rm -f {init}", sudo=True) - with open(template, "r") as src_file: + with open(template, u"rt") as src_file: src = Template(src_file.read()) exec_cmd_no_error( self._node, f"echo '{src.safe_substitute(**kwargs)}' | " @@ -611,7 +611,7 @@ class QemuUtils: message = f"QEMU: Start failed on {self._node[u'host']}!" try: DUTSetup.check_huge_page( - self._node, u"/dev/hugepages", self._opt.get(u"mem")) + self._node, u"/dev/hugepages", int(self._opt.get(u"mem"))) exec_cmd_no_error( self._node, cmd_opts, timeout=300, sudo=True, message=message