Don't override extra specs with config in VMAX

A recent merge in https://review.openstack.org/#/c/157679
brought in regression because it tied volume type extra specs to
config file settings.

This patch rolled back most of the changes and don't let extra specs
be overwritten by the config file settings. Intervals and retries
will be read from the config file.

Partial-Bug: #1425641
Change-Id: I7b7959d64f9cc5e954d03f56f6a37021c4c0e9e1
This commit is contained in:
Xing Yang
2015-03-09 11:18:11 -04:00
parent 33b8853816
commit ffc8677232
3 changed files with 403 additions and 275 deletions

View File

@@ -343,7 +343,7 @@ class EMCVMAXUtils(object):
:param extraSpecs: extraSpecs dict
:returns: JOB_RETRIES or user defined
"""
if extraSpecs:
if extraSpecs and RETRIES in extraSpecs:
jobRetries = extraSpecs[RETRIES]
else:
jobRetries = JOB_RETRIES
@@ -355,7 +355,7 @@ class EMCVMAXUtils(object):
:param extraSpecs: extraSpecs dict
:returns: INTERVAL_10_SEC or user defined
"""
if extraSpecs:
if extraSpecs and INTERVAL in extraSpecs:
intervalInSecs = extraSpecs[INTERVAL]
else:
intervalInSecs = INTERVAL_10_SEC
@@ -827,13 +827,13 @@ class EMCVMAXUtils(object):
If it is not there then the default will be used.
:param fileName: the path and name of the file
:returns: string -- interval - the interval in seconds
:returns: interval - the interval in seconds
"""
interval = self._parse_from_file(fileName, 'Interval')
if interval:
return interval
else:
LOG.debug("Interval not found in config file.")
LOG.debug("Interval not overridden, default of 10 assumed.")
return None
def parse_retries_from_file(self, fileName):
@@ -842,13 +842,13 @@ class EMCVMAXUtils(object):
If it is not there then the default will be used.
:param fileName: the path and name of the file
:returns: string -- retries - the max number of retries
:returns: retries - the max number of retries
"""
retries = self._parse_from_file(fileName, 'Retries')
if retries:
return retries
else:
LOG.debug("Retries not found in config file.")
LOG.debug("Retries not overridden, default of 60 assumed.")
return None
def parse_pool_instance_id(self, poolInstanceId):