peng.jianhua created RANGER-1769:
------------------------------------

             Summary: The update_property.py should exit the loop to improve 
execution efficiency after the attribute value is changed.
                 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


Even if the attribute value is first matched, the following code segment will 
still traverse all the attributes.
{code}
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 changed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to