]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Ensure nvp resources are tagged with an up-to-date version of Neutron
authorarmando-migliaccio <amigliaccio@nicira.com>
Fri, 16 Aug 2013 20:58:46 +0000 (13:58 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Fri, 16 Aug 2013 21:00:44 +0000 (14:00 -0700)
This is made possible by using version.version_info

Fixes bug #1213242

Change-Id: Iad75f7c6f6c045a2f473388529174cf02f413899

neutron/plugins/nicira/nvplib.py
neutron/tests/unit/nicira/test_nvplib.py

index 9cbf72f8d44b1539110526a52b85df41b47fdce9..0fa1e2aedcab9b7f7bf057b4292189c469f8c950 100644 (file)
@@ -35,6 +35,7 @@ from neutron.openstack.common import log
 from neutron.plugins.nicira.common import (
     exceptions as nvp_exc)
 from neutron.plugins.nicira import NvpApiClient
+from neutron.version import version_info
 
 
 LOG = log.getLogger(__name__)
@@ -55,7 +56,7 @@ LROUTERNAT_RESOURCE = "nat/lrouter"
 LQUEUE_RESOURCE = "lqueue"
 GWSERVICE_RESOURCE = "gateway-service"
 # Current neutron version
-NEUTRON_VERSION = "2013.1"
+NEUTRON_VERSION = version_info.release_string()
 # Other constants for NVP resource
 MAX_DISPLAY_NAME_LEN = 40
 # Constants for NAT rules
index c2c722da362f41aab3d17ca5948535a7c9cc702c..02f4ea1fa2a10e094601b45a9dbc211cc8c95357 100644 (file)
@@ -376,7 +376,7 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
 
         router = {'display_name': router_name,
                   'uuid': router_id,
-                  'tags': [{'scope': 'quantum', 'tag': '2013.1'},
+                  'tags': [{'scope': 'quantum', 'tag': nvplib.NEUTRON_VERSION},
                            {'scope': 'os_tid', 'tag': '%s' % tenant_id}],
                   'distributed': False,
                   'routing_config': {'type': 'RoutingTableRoutingConfig',
@@ -416,7 +416,8 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
                          'type': 'RouterNextHop'},
                     'type': 'SingleDefaultRouteImplicitRoutingConfig'},
                     'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'},
-                             {'scope': 'quantum', 'tag': '2013.1'}],
+                             {'scope': 'quantum',
+                              'tag': nvplib.NEUTRON_VERSION}],
                     'type': 'LogicalRouterConfig'}
         self.assertEqual(expected, body)
 
@@ -429,7 +430,8 @@ class TestNvplibExplicitLRouters(NvplibTestCase):
         expected = {'display_name': 'fake_router_name',
                     'routing_config': {'type': 'RoutingTableRoutingConfig'},
                     'tags': [{'scope': 'os_tid', 'tag': 'fake_tenant_id'},
-                             {'scope': 'quantum', 'tag': '2013.1'}],
+                             {'scope': 'quantum',
+                              'tag': nvplib.NEUTRON_VERSION}],
                     'type': 'LogicalRouterConfig'}
         self.assertEqual(expected, body)