Repository: incubator-hawq Updated Branches: refs/heads/master c68abc628 -> 3ffcf2a00
HAWQ-339. Validate standby hostname while parsing hawq-site.xml Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/3ffcf2a0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/3ffcf2a0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/3ffcf2a0 Branch: refs/heads/master Commit: 3ffcf2a005dba78485349197ed52d4ae9602bf56 Parents: c68abc6 Author: rlei <[email protected]> Authored: Tue Jan 12 23:16:56 2016 +0800 Committer: rlei <[email protected]> Committed: Wed Jan 13 18:29:01 2016 +0800 ---------------------------------------------------------------------- tools/bin/hawqpylib/hawqlib.py | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3ffcf2a0/tools/bin/hawqpylib/hawqlib.py ---------------------------------------------------------------------- diff --git a/tools/bin/hawqpylib/hawqlib.py b/tools/bin/hawqpylib/hawqlib.py index eb855f1..1e792d2 100755 --- a/tools/bin/hawqpylib/hawqlib.py +++ b/tools/bin/hawqpylib/hawqlib.py @@ -89,12 +89,18 @@ class HawqXMLParser: def get_all_values(self): with open(self.xml_file) as f: xmldoc = minidom.parse(f) + for node in xmldoc.getElementsByTagName('property'): name, value = (node.getElementsByTagName('name')[0].childNodes[0].data.encode('ascii'), node.getElementsByTagName('value')[0].childNodes[0].data.encode('ascii')) if value == '': value == 'None' self.hawq_dict[name] = value + + if 'hawq_standby_address_host' in self.hawq_dict: + if self.hawq_dict['hawq_standby_address_host'].lower() in ['none', '', 'localhost']: + del self.hawq_dict['hawq_standby_address_host'] + return None def get_xml_doc(self):
