MH: Limit enabled versions for agentless mode

DHCP and metadata agentless modes are only available when
using the 4.1 version of the backend.

This patch reflects this constraint amending the routine
check_service_requirements.

Cherry-picked from: efd6bb9
Change-Id: Ib195d32b1a52e79162a1d296a8cd4275efc556c6
Closes-Bug: #1474785
This commit is contained in:
Salvatore Orlando 2015-07-15 03:21:29 -07:00
parent 62bf6fa10b
commit a28ba01b95
2 changed files with 6 additions and 6 deletions

View File

@ -192,9 +192,9 @@ def is_user_port(p, check_dev_id=False):
def check_services_requirements(cluster):
ver = cluster.api_client.get_version()
# It sounds like 4.1 is the first one where DHCP in NSX
# will have the experimental feature
if ver.major >= 4 and ver.minor >= 1:
# 4.1 is the first and only release where DHCP in NSX
# will have this feature, as experimental
if ver.major == 4 and ver.minor == 1:
cluster_id = cfg.CONF.default_service_cluster_uuid
if not lsn_api.service_cluster_exists(cluster, cluster_id):
raise p_exc.ServiceClusterUnavailable(cluster_id=cluster_id)

View File

@ -145,10 +145,10 @@ class ConfigurationTest(base.BaseTestCase):
cfg.CONF.set_override('core_plugin', vmware.PLUGIN_NAME)
self.assertEqual(config.AgentModes.AGENTLESS,
cfg.CONF.NSX.agent_mode)
# The version returned from NSX does not really matter here
# The version returned from NSX matter as it has be exactly 4.1
with mock.patch.object(client.NsxApiClient,
'get_version',
return_value=version.Version("9.9")):
return_value=version.Version("4.1")):
with mock.patch.object(lsnlib,
'service_cluster_exists',
return_value=True):
@ -207,7 +207,7 @@ class ConfigurationTest(base.BaseTestCase):
cfg.CONF.NSX.agent_mode)
with mock.patch.object(client.NsxApiClient,
'get_version',
return_value=version.Version("4.2")):
return_value=version.Version("4.1")):
with mock.patch.object(lsnlib,
'service_cluster_exists',
return_value=True):