Repository: incubator-ranger Updated Branches: refs/heads/master 9a4837dbf -> 80cef9d43
RANGER-785: Fixed spurious error message when installing ranger-tagsync Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/80cef9d4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/80cef9d4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/80cef9d4 Branch: refs/heads/master Commit: 80cef9d43bf0e1f481861c258da64dc0e4c2a5ba Parents: 9a4837d Author: Abhay Kulkarni <[email protected]> Authored: Fri Dec 18 14:39:27 2015 -0800 Committer: Madhan Neethiraj <[email protected]> Committed: Sat Dec 19 01:33:16 2015 -0800 ---------------------------------------------------------------------- tagsync/scripts/setup.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/80cef9d4/tagsync/scripts/setup.py ---------------------------------------------------------------------- diff --git a/tagsync/scripts/setup.py b/tagsync/scripts/setup.py index f7455b8..1c8552b 100755 --- a/tagsync/scripts/setup.py +++ b/tagsync/scripts/setup.py @@ -143,20 +143,21 @@ def writeXMLUsingProperties(xmlTemplateFileName,prop,xmlOutputFileName): # Expected value is 'clusterName,componentName,serviceName;clusterName,componentName,serviceName' ... # Blanks are not supported anywhere in the value. valueString = str(prop[name]) - multiValues = valueString.split(';') - listLen = len(multiValues) - index = 0 - while index < listLen: - parts = multiValues[index].split(',') - if len(parts) == 3: - newConfig = ET.SubElement(root, 'property') - newName = ET.SubElement(newConfig, 'name') - newValue = ET.SubElement(newConfig, 'value') - newName.text = TAGSYNC_INSTALL_PROP_PREFIX_FOR_ATLAS_RANGER_MAPPING + str(parts[1]) + TAGSYNC_ATLAS_CLUSTER_IDENTIFIER + str(parts[0]) + TAGSYNC_INSTALL_PROP_SUFFIX_FOR_ATLAS_RANGER_MAPPING - newValue.text = str(parts[2]) - else: - print "ERROR: incorrect syntax for %s, value=%s" % (TAGSYNC_ATLAS_TO_RANGER_SERVICE_MAPPING, multiValues[index]) - index += 1 + if valueString and valueString.strip(): + multiValues = valueString.split(';') + listLen = len(multiValues) + index = 0 + while index < listLen: + parts = multiValues[index].split(',') + if len(parts) == 3: + newConfig = ET.SubElement(root, 'property') + newName = ET.SubElement(newConfig, 'name') + newValue = ET.SubElement(newConfig, 'value') + newName.text = TAGSYNC_INSTALL_PROP_PREFIX_FOR_ATLAS_RANGER_MAPPING + str(parts[1]) + TAGSYNC_ATLAS_CLUSTER_IDENTIFIER + str(parts[0]) + TAGSYNC_INSTALL_PROP_SUFFIX_FOR_ATLAS_RANGER_MAPPING + newValue.text = str(parts[2]) + else: + print "ERROR: incorrect syntax for %s, value=%s" % (TAGSYNC_ATLAS_TO_RANGER_SERVICE_MAPPING, multiValues[index]) + index += 1 root.remove(config) else: config.find('value').text = str(prop[name])
