From 61138bfec980625bec6c219b9e27685c281e5965 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 12 Aug 2021 16:41:38 +0200 Subject: Update to Alpine 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also fixes lots of new pylint warnings. Change-Id: I3376aee5649596c53bc2941ad4d8e0674a2967fe Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py') diff --git a/functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py b/functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py index b159ddda4..db276cfdb 100644 --- a/functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py +++ b/functest/opnfv_tests/vnf/router/vnf_controller/vm_controller.py @@ -101,10 +101,8 @@ class VmController(): def command_create_and_execute(self, ssh, test_cmd_file_path, cmd_input_param, prompt_file_path): - prompt_file = open(prompt_file_path, - 'r') - prompt = yaml.safe_load(prompt_file) - prompt_file.close() + with open(prompt_file_path, 'r') as prompt_file: + prompt = yaml.safe_load(prompt_file) config_mode_prompt = prompt["config_mode"] commands = self.command_gen_from_template(test_cmd_file_path, -- cgit 1.2.3-korg