Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/2] controller: fix warning for pyyaml loader
Date: Wed,  8 May 2019 10:59:00 +0900	[thread overview]
Message-ID: <1557280741-7465-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1557280741-7465-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 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


  reply	other threads:[~2019-05-08  2:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  1:58 [spp] [PATCH 0/2] Fix misc issues of python scripts ogawa.yasufumi
2019-05-08  1:59 ` ogawa.yasufumi [this message]
2019-05-08  1:59 ` [spp] [PATCH 2/2] controller: change file mode of SPP CLI ogawa.yasufumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557280741-7465-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).