Merge "Ensure nvp resources are tagged with an up-to-date version of Neutron"

This commit is contained in:
Jenkins 2013-08-19 17:34:50 +00:00 committed by Gerrit Code Review
commit b3e68ed5f6
2 changed files with 7 additions and 4 deletions

View File

@ -35,6 +35,7 @@ from neutron.openstack.common import log
from neutron.plugins.nicira.common import ( from neutron.plugins.nicira.common import (
exceptions as nvp_exc) exceptions as nvp_exc)
from neutron.plugins.nicira import NvpApiClient from neutron.plugins.nicira import NvpApiClient
from neutron.version import version_info
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -55,7 +56,7 @@ LROUTERNAT_RESOURCE = "nat/lrouter"
LQUEUE_RESOURCE = "lqueue" LQUEUE_RESOURCE = "lqueue"
GWSERVICE_RESOURCE = "gateway-service" GWSERVICE_RESOURCE = "gateway-service"
# Current neutron version # Current neutron version
NEUTRON_VERSION = "2013.1" NEUTRON_VERSION = version_info.release_string()
# Other constants for NVP resource # Other constants for NVP resource
MAX_DISPLAY_NAME_LEN = 40 MAX_DISPLAY_NAME_LEN = 40
# Constants for NAT rules # Constants for NAT rules

View File

@ -376,7 +376,7 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
router = {'display_name': router_name, router = {'display_name': router_name,
'uuid': router_id, 'uuid': router_id,
'tags': [{'scope': 'quantum', 'tag': '2013.1'}, 'tags': [{'scope': 'quantum', 'tag': nvplib.NEUTRON_VERSION},
{'scope': 'os_tid', 'tag': '%s' % tenant_id}], {'scope': 'os_tid', 'tag': '%s' % tenant_id}],
'distributed': False, 'distributed': False,
'routing_config': {'type': 'RoutingTableRoutingConfig', 'routing_config': {'type': 'RoutingTableRoutingConfig',
@ -416,7 +416,8 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
'type': 'RouterNextHop'}, 'type': 'RouterNextHop'},
'type': 'SingleDefaultRouteImplicitRoutingConfig'}, 'type': 'SingleDefaultRouteImplicitRoutingConfig'},
'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'}, 'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'},
{'scope': 'quantum', 'tag': '2013.1'}], {'scope': 'quantum',
'tag': nvplib.NEUTRON_VERSION}],
'type': 'LogicalRouterConfig'} 'type': 'LogicalRouterConfig'}
self.assertEqual(expected, body) self.assertEqual(expected, body)
@ -429,7 +430,8 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
expected = {'display_name': 'fake_router_name', expected = {'display_name': 'fake_router_name',
'routing_config': {'type': 'RoutingTableRoutingConfig'}, 'routing_config': {'type': 'RoutingTableRoutingConfig'},
'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'}, 'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'},
{'scope': 'quantum', 'tag': '2013.1'}], {'scope': 'quantum',
'tag': nvplib.NEUTRON_VERSION}],
'type': 'LogicalRouterConfig'} 'type': 'LogicalRouterConfig'}
self.assertEqual(expected, body) self.assertEqual(expected, body)