From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5B9F4A0096 for ; Wed, 8 May 2019 04:01:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 538D1DE3; Wed, 8 May 2019 04:01:23 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 025492BB8 for ; Wed, 8 May 2019 04:01:21 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4821HL4022989; Wed, 8 May 2019 11:01:20 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 5F4BAEA7093; Wed, 8 May 2019 11:01:17 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 516FAEA702A; Wed, 8 May 2019 11:01:17 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Wed, 8 May 2019 10:59:00 +0900 Message-Id: <1557280741-7465-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557280741-7465-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1557280741-7465-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/2] controller: fix warning for pyyaml loader X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa Using `yaml.load` without loader has deprecated. This update is to add loader `FullLoader` to the method call for fixing warning. Signed-off-by: Yasufumi Ogawa --- src/controller/commands/topo.py | 2 +- src/controller/shell.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controller/commands/topo.py b/src/controller/commands/topo.py index e8afa4a..3b24c1a 100644 --- a/src/controller/commands/topo.py +++ b/src/controller/commands/topo.py @@ -375,7 +375,7 @@ class SppTopo(object): stat = stat.replace("\x00", "") stat = stat.replace("'", "") - stat_obj = yaml.load(stat) + stat_obj = yaml.load(stat, Loader=yaml.FullLoader) res = {} res['sec_id'] = sec_id res['status'] = stat_obj['status'] diff --git a/src/controller/shell.py b/src/controller/shell.py index e3f1ff8..057f70a 100644 --- a/src/controller/shell.py +++ b/src/controller/shell.py @@ -28,7 +28,8 @@ class Shell(cmd.Cmd, object): try: config_file = "{}/config/default.yml".format( os.path.dirname(__file__)) - cli_config = yaml.load(open(config_file)) + cli_config = yaml.load(open(config_file), + Loader=yaml.FullLoader) except IOError as e: print('Error: no config file found!') print(e) -- 2.17.1