ofproto: exception during startup related ofp module detaction

This patch fixes the following exception.

ryu/controller/ofp_event.py: update
cd /opt/stack/ryu && /opt/stack/ryu/bin/ryu-mana ^Mger --config-file /etc/ryu/ryu.conf || touch "/opt/stack/status/stack/ryu.failur ^Me"
> Traceback (most recent call last):
>   File "/opt/stack/ryu/bin/ryu-manager", line 41, in <module>
>     from ryu.base.app_manager import AppManager
>   File "/opt/stack/ryu/ryu/base/app_manager.py", line 22, 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 69, in <module>
>     for ofp_mods in ofproto.get_ofp_module():
> TypeError: get_ofp_module() takes exactly 1 argument (0 given)

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests/ofproto: add unit test for ofproto automatic detection

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
use dpid_to_str in some places

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of: StringifyMixin

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of10: sprinkle StringifyMixin

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/quantum_adapter: unbreak quantum change

Now quantum checks attributes strictly on REST request by
the changeset of 61bdda62e8950a9747073e2be7b81cdea0af2f25
Don't send non-standard attribute.

> commit 61bdda62e8950a9747073e2be7b81cdea0af2f25
> Author: Jason Zhang <zhesen@nttmcl.com>
> Date:   Tue Feb 12 18:40:12 2013 -0800
>
>     Raising error if invalid attribute passed in.
>
>     400 will be returned when invalid attributes
>     are passed into Quantum API.
>
>     Fixed the some test cases failed since the
>     enforcement of invalid attribute checking
>
>     Fixes: bug #1076179
>
>     Change-Id: I4e9e2891c444f9dcd051f7b325d3c9403b28db86

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/gre_tunnel: pylint

> E: 60,18:PortSet.EventTunnelKeyDel.__init__: Undefined variable 'EventTunnelKeyDel'
> W: 18,0: Unused import logging

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
run_tests: make python interpreter overridable

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of13: Fix for OFPQueueGetConfigReply/Request

Signed-off-by: Philipp Aeschlimann <aepp@zhaw.ch>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Merge branch 'master' of github.com:osrg/ryu
test_parser_v10: remove tests for __str__

Following errors occur at current master
(commit 21692141dc7e8be2d44338ce4eff5af584e4ff8f)

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPFlowRemoved)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 4080, in test_parser
    eq_(str(cookie['val']), check['cookie'])
KeyError: 'cookie'

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPPacketIn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3782, in test_parser
    ok_(self._test_parser())
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3774, in _test_parser
    eq_(str(buffer_id['val']), check['buffer_id'])
KeyError: 'buffer_id'

======================================================================
ERROR: test_parser_padding (ryu.tests.unit.ofproto.test_parser_v10.TestOFPPacketIn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3785, in test_parser_padding
    ok_(self._test_parser(True))
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3774, in _test_parser
    eq_(str(buffer_id['val']), check['buffer_id'])
KeyError: 'buffer_id'

======================================================================
ERROR: test_str (ryu.tests.unit.ofproto.test_parser_v10.TestOFPQueuePropMinRate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 2615, in test_str
    eq_(check['rate'], str(self.rate['val']))
KeyError: 'rate'

======================================================================
ERROR: test_str (ryu.tests.unit.ofproto.test_parser_v10.TestOFPQueuePropNone)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 2564, in test_str
    eq_(check['property'], str(self.property['val']))
KeyError: 'property'

======================================================================
ERROR: test_parser (ryu.tests.unit.ofproto.test_parser_v10.TestOFPSwitchFeatures)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hideki/ryu/ryu/tests/unit/ofproto/test_parser_v10.py", line 3580, in test_parser
    eq_(check['ports'].find('OFPPhyPort'), 0)
KeyError: 'ports'

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/packet/vrrp: fix is_valid()

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests/unit/packet/test_vrrp: add tests for is_valid()

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
docs: fix ryu module import

readthedocs.org complains about the failure about ryu module import.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of1.0: use tun_id instead of tun_id_

Since there is no name conflict with tun_id, no reason to use tun_id_
instead of tun_id.
This is needed for OF message conversion from/to json later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofproto/ofproto_parser: pylint

************* Module ryu.ofproto.ofproto_parser
W:155,4:MsgBase.__init__: __init__ method from base class 'StringifyMixin' is not called
W:186,8:MsgBase.parser: Redefining name 'msg' from outer scope (line 48)
W:240,14:ofp_attrs: Redefining name 'msg' from outer scope (line 48)
W:268,17:msg_str_attr: Redefining name 'msg' from outer scope (line 48)
E:270,20:msg_str_attr: Undefined variable 'ofp_attr'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
lib/packet: DHCP packet parser/serializer

Add DHCP encoder/decoder class.

Signed-off-by: TAKESHITA Noboru <takeshita.noboru@yes.nttcom.ne.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add Packet library API Reference

Add DHCP encoder/decoder class.

Signed-off-by: TAKESHITA Noboru <takeshita.noboru@yes.nttcom.ne.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: make test_packet work stand-alone

Prevent missing imports when running
  ./run_tests.sh ryu.tests.unit.packet

Signed-off-by: Shaun Crampton <Shaun.Crampton@metaswitch.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
fix 77effb29 regression

The following commit broke ofp_attrs():

commit 77effb29a69eeb6d320dd9a7554924b2578c3c95
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Mon May 27 18:15:27 2013 +0900

    ofproto/ofproto_parser: pylint

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>