ofctl_rest: fix mod_meter_entry in OpenFlow1.0/1.2

mod_meter_entry causes the following error when the protocol version is 1.0 or 1.2.

  AttributeError: 'module' object has no attribute 'OFPMC_ADD'

this patch fixes this problem.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yuichi Ito 2014-01-07 11:32:40 +09:00 committed by FUJITA Tomonori
parent 79e2460c20
commit 7a10aafd39

View File

@ -256,6 +256,11 @@ class StatsController(ControllerBase):
if dp is None:
return Response(status=404)
if dp.ofproto.OFP_VERSION == ofproto_v1_0.OFP_VERSION or \
dp.ofproto.OFP_VERSION == ofproto_v1_2.OFP_VERSION:
LOG.debug('Unsupported OF protocol')
return Response(status=501)
if cmd == 'add':
cmd = dp.ofproto.OFPMC_ADD
elif cmd == 'modify':