You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "peng.jianhua (JIRA)" <ji...@apache.org> on 2017/09/07 13:23:00 UTC

[jira] [Updated] (RANGER-1769) The update_property.py should exit the loop to improve execution efficiency once the attribute value is set.

     [ https://issues.apache.org/jira/browse/RANGER-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

peng.jianhua updated RANGER-1769:
---------------------------------
    Summary: The update_property.py should exit the loop to improve execution efficiency once the attribute value is set.  (was: The update_property.py should exit the loop to improve execution efficiency after the attribute value is changed.)

> 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
>
> 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 changed.



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