Hello,
This change causes the following issue.
----------
Traceback (most recent call last):
File "/opt/stack/ryu/bin/ryu-manager", line 42, in <module>
from ryu.base.app_manager import AppManager
File "/opt/stack/ryu/ryu/base/app_manager.py", line 25, in <module>
from ryu.controller.handler import register_instance
File "/opt/stack/ryu/ryu/controller/handler.py", line 20, in <module>
from ryu.controller import ofp_event
File "/opt/stack/ryu/ryu/controller/ofp_event.py", line 75, in <module>
_create_ofp_msg_ev_from_module(m)
File "/opt/stack/ryu/ryu/controller/ofp_event.py", line 60, in
_create_ofp_msg_ev_from_module
mod = utils.import_module(modname)
File "/opt/stack/ryu/ryu/utils.py", line 35, in import_module
__import__(name)
File "/opt/stack/ryu/ryu/ofproto/ofproto_v1_0_parser.py", line 26, in <module>
import utils.round_up
ImportError: No module named utils.round_up
---------
How about this?
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
b/ryu/ofproto/ofproto_v1_0_parser.py
index e44d6ae..4d7ab16 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -23,7 +23,7 @@ from ryu.lib import mac
from . import ofproto_parser
from . import ofproto_v1_0
from . import nx_match
-import utils.round_up
+from ryu.utils import round_up
import logging
LOG = logging.getLogger('ryu.ofproto.ofproto_v1_0_parser')
@@ -1070,7 +1070,7 @@ class NXFlowStats(object):
actions = []
total_len = original_offset + nxflow_stats.length
match_len = nxflow_stats.match_len
- offset += utils.round_up(match_len, 8) - match_len
+ offset += round_up(match_len, 8) - match_len
while offset < total_len:
action = OFPAction.parser(buf, offset)
actions.append(action)
Thanks,
Kaneko
2013/4/1 can. <[email protected]>:
> Oops, I'm sorry.
>
>
> From 2e9358c4f8fa0de8b6f5c49b714248d1ff210a70 Mon Sep 17 00:00:00 2001
> From: Can Zhang <[email protected]>
> Date: Mon, 1 Apr 2013 09:11:20 +0800
> Subject: [PATCH] use utils.round_up
>
> Signed-off-by: Can Zhang <[email protected]>
> ---
> ryu/ofproto/ofproto_v1_0_parser.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
> b/ryu/ofproto/ofproto_v1_0_parser.py
> index a6d3977..e44d6ae 100644
> --- a/ryu/ofproto/ofproto_v1_0_parser.py
> +++ b/ryu/ofproto/ofproto_v1_0_parser.py
> @@ -23,6 +23,7 @@ from ryu.lib import mac
> from . import ofproto_parser
> from . import ofproto_v1_0
> from . import nx_match
> +import utils.round_up
>
> import logging
> LOG = logging.getLogger('ryu.ofproto.ofproto_v1_0_parser')
> @@ -1069,7 +1070,7 @@ class NXFlowStats(object):
> actions = []
> total_len = original_offset + nxflow_stats.length
> match_len = nxflow_stats.match_len
> - offset += (match_len + 7) / 8 * 8 - match_len
> + offset += utils.round_up(match_len, 8) - match_len
> while offset < total_len:
> action = OFPAction.parser(buf, offset)
> actions.append(action)
> --
> 1.7.11.1
>
>
>
> 2013/4/1 FUJITA Tomonori <[email protected]>
>>
>> On Mon, 1 Apr 2013 08:51:20 +0800
>> Can Zhang <[email protected]> wrote:
>>
>> >>From 8bc4236b1cee2619d9b4ce938f6901e2fcecd283 Mon Sep 17 00:00:00 2001
>> > From: Can Zhang <[email protected]>
>> > Date: Mon, 1 Apr 2013 08:49:27 +0800
>> > Subject: [PATCH] use utils.round_up
>> >
>> > Signed-off-by: Can Zhang <[email protected]>
>> > ---
>> > ryu/ofproto/ofproto_v1_0_parser.py | 3 ++-
>> > 1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
>> > b/ryu/ofproto/ofproto_v1_0_parser.py
>> > index a6d3977..49949e8 100644
>> > --- a/ryu/ofproto/ofproto_v1_0_parser.py
>> > +++ b/ryu/ofproto/ofproto_v1_0_parser.py
>> > @@ -23,6 +23,7 @@ from ryu.lib import mac
>> > from . import ofproto_parser
>> > from . import ofproto_v1_0
>> > from . import nx_match
>> > +import ryu.utils
>> >
>> > import logging
>> > LOG = logging.getLogger('ryu.ofproto.ofproto_v1_0_parser')
>> > @@ -1069,7 +1070,7 @@ class NXFlowStats(object):
>> > actions = []
>> > total_len = original_offset + nxflow_stats.length
>> > match_len = nxflow_stats.match_len
>> > - offset += (match_len + 7) / 8 * 8 - match_len
>> > + offset += utils.round_up(match_len, 8)
>>
>> ?
>> offset += utils.round_up(match_len, 8) - match_len
>>
>> > while offset < total_len:
>> > action = OFPAction.parser(buf, offset)
>> > actions.append(action)
>> > --
>> > 1.7.11.1
>> >
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Own the Future-Intel® Level Up Game Demo Contest 2013
>> > Rise to greatness in Intel's independent game demo contest.
>> > Compete for recognition, cash, and the chance to get your game
>> > on Steam. $5K grand prize plus 10 genre and skill prizes.
>> > Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> > _______________________________________________
>> > Ryu-devel mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
>
>
> --
> Best regards,
> Can Zhang
>
> ------------------------------------------------------------------------------
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel