Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 0/2] Fix misc issues of python scripts
@ 2019-05-08  1:58 ogawa.yasufumi
  2019-05-08  1:59 ` [spp] [PATCH 1/2] controller: fix warning for pyyaml loader ogawa.yasufumi
  2019-05-08  1:59 ` [spp] [PATCH 2/2] controller: change file mode of SPP CLI ogawa.yasufumi
  0 siblings, 2 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:58 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

* As PyYAML has changed to require load() specify `Loader` option
  explicitly or show warning message, add this option to the method
  calling.

* Putting executable file in `src` directory is not recommended, but
  `src/spp.py` is as remained as executable. This update is change file
  mode.

Yasufumi Ogawa (2):
  controller: fix warning for pyyaml loader
  controller: change file mode of SPP CLI

 src/controller/commands/topo.py | 2 +-
 src/controller/shell.py         | 3 ++-
 src/spp.py                      | 0
 3 files changed, 3 insertions(+), 2 deletions(-)
 mode change 100755 => 100644 src/spp.py

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 1/2] controller: fix warning for pyyaml loader
  2019-05-08  1:58 [spp] [PATCH 0/2] Fix misc issues of python scripts ogawa.yasufumi
@ 2019-05-08  1:59 ` ogawa.yasufumi
  2019-05-08  1:59 ` [spp] [PATCH 2/2] controller: change file mode of SPP CLI ogawa.yasufumi
  1 sibling, 0 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:59 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [spp] [PATCH 2/2] controller: change file mode of SPP CLI
  2019-05-08  1:58 [spp] [PATCH 0/2] Fix misc issues of python scripts ogawa.yasufumi
  2019-05-08  1:59 ` [spp] [PATCH 1/2] controller: fix warning for pyyaml loader ogawa.yasufumi
@ 2019-05-08  1:59 ` ogawa.yasufumi
  1 sibling, 0 replies; 3+ messages in thread
From: ogawa.yasufumi @ 2019-05-08  1:59 UTC (permalink / raw)
  To: spp, ferruh.yigit, ogawa.yasufumi

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

Executable file should not be included in `src` directory, or warned
while checking with `devtools/checkpatches.sh` of DPDK.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/spp.py | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 src/spp.py

diff --git a/src/spp.py b/src/spp.py
old mode 100755
new mode 100644
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-08  2:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08  1:58 [spp] [PATCH 0/2] Fix misc issues of python scripts ogawa.yasufumi
2019-05-08  1:59 ` [spp] [PATCH 1/2] controller: fix warning for pyyaml loader ogawa.yasufumi
2019-05-08  1:59 ` [spp] [PATCH 2/2] controller: change file mode of SPP CLI ogawa.yasufumi

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).