[
https://issues.apache.org/jira/browse/RANGER-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Qiang Zhang resolved RANGER-1769.
---------------------------------
Resolution: Fixed
Fix Version/s: master
1.0.0
> The update_property.py should exit the loop to improve execution efficiency
> once the attribute value is set.
> ------------------------------------------------------------------------------------------------------------
>
> Key: RANGER-1769
> URL: https://issues.apache.org/jira/browse/RANGER-1769
> Project: Ranger
> Issue Type: Bug
> Components: admin
> Affects Versions: 1.0.0, master
> Reporter: peng.jianhua
> Assignee: peng.jianhua
> Priority: Minor
> Labels: patch
> Fix For: 1.0.0, master
>
> Attachments:
> 0001-RANGER-1769-The-update_property.py-should-exit-the-l.patch
>
>
> Even if the attribute value is first matched, the following code segment will
> still traverse all the attributes.
> {code:title=update_property.py|borderStyle=solid}
> root = xml.getroot()
> for child in root.findall('property'):
> name = child.find("name").text.strip()
> if name == property_name:
> child.find("value").text = property_value
> xml.write(xml_path)
> {code}
> The program should exit the loop to improve execution efficiency once the
> attribute value is set.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)