Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/cmd/of_config_cli.py | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/ryu/cmd/of_config_cli.py b/ryu/cmd/of_config_cli.py
index db5b73e..04596ac 100755
--- a/ryu/cmd/of_config_cli.py
+++ b/ryu/cmd/of_config_cli.py
@@ -73,11 +73,6 @@ def validate(tree):
print schema.error_log
-def _pythonify(name):
- # XXX code duplication
- return name.replace('-', '_')
-
-
class Cmd(cmd.Cmd):
def __init__(self, *args, **kwargs):
self._in_onecmd = False
@@ -238,7 +233,7 @@ class Cmd(cmd.Cmd):
conf = p.configuration
for k in self._port_settings:
try:
- v = getattr(conf, _pythonify(k))
+ v = getattr(conf, k)
except AttributeError:
continue
print k, v
@@ -271,7 +266,7 @@ class Cmd(cmd.Cmd):
ofc.OFPortType(
resource_id=port,
configuration=ofc.OFPortConfigurationType(
- **{_pythonify(key): value}))
+ **{key: value}))
]
)
)
@@ -322,7 +317,7 @@ class Cmd(cmd.Cmd):
conf = q.properties
for k in self._queue_settings:
try:
- v = getattr(conf, _pythonify(k))
+ v = getattr(conf, k)
except AttributeError:
continue
print k, v
@@ -355,7 +350,7 @@ max-rate 100
ofc.OFQueueType(
resource_id=queue,
properties=ofc.OFQueuePropertiesType(
- **{_pythonify(key): value})),
+ **{key: value})),
]
)
)
@@ -471,7 +466,7 @@ max-rate 100
print l.id
for k in self._lsw_settings:
try:
- v = getattr(l, _pythonify(k))
+ v = getattr(l, k)
except AttributeError:
continue
print k, v
@@ -501,7 +496,7 @@ lost-connection-behavior failStandaloneMode
logical_switches=ofc.OFCapableSwitchLogicalSwitchesType(
switch=[ofc.OFLogicalSwitchType(
id=lsw,
- **{_pythonify(key): value}
+ **{key: value}
)]
)
)
--
1.8.3.1
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel