[jira] [Updated] (AMBARI-25910) modify Function hasattr from python2 to python3

2023-03-21 Thread Charming Wu (Jira)


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

Charming Wu updated AMBARI-25910:
-
Environment: 
{*}Ambari:{*}Ambari-2.7.5

*OS:*        OpenEuler-22.03

*Python:* Python 3.9.9

> modify Function hasattr from python2 to python3
> ---
>
> Key: AMBARI-25910
> URL: https://issues.apache.org/jira/browse/AMBARI-25910
> Project: Ambari
>  Issue Type: Sub-task
>  Components: ambari-client
>Affects Versions: 2.7.5
> Environment: {*}Ambari:{*}Ambari-2.7.5
> *OS:*        OpenEuler-22.03
> *Python:* Python 3.9.9
>Reporter: Charming Wu
>Priority: Major
>  Labels: hasattr, python2, python3
> Attachments: image-2023-03-22-12-02-53-173.png
>
>
> In python2, hasattr() function catched all attributes lookup exceptions and 
> return False.
> But in python3, it only catch AttributeError and return False, when it comes 
> to other exceptions, the call stack will be bubbled up.
>  
> In order to adapt from python2 to python3, I would like to  add a try-catch 
> block and catch all exceptions and return False:
> !image-2023-03-22-12-02-53-173.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@ambari.apache.org
For additional commands, e-mail: issues-h...@ambari.apache.org



[jira] [Updated] (AMBARI-25910) modify Function hasattr from python2 to python3

2023-03-21 Thread Charming Wu (Jira)


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

Charming Wu updated AMBARI-25910:
-
Labels: hasattr python2 python3  (was: )

> modify Function hasattr from python2 to python3
> ---
>
> Key: AMBARI-25910
> URL: https://issues.apache.org/jira/browse/AMBARI-25910
> Project: Ambari
>  Issue Type: Sub-task
>  Components: ambari-client
>Affects Versions: 2.7.5
>Reporter: Charming Wu
>Priority: Major
>  Labels: hasattr, python2, python3
> Attachments: image-2023-03-22-12-02-53-173.png
>
>
> In python2, hasattr() function catched all attributes lookup exceptions and 
> return False.
> But in python3, it only catch AttributeError and return False, when it comes 
> to other exceptions, the call stack will be bubbled up.
>  
> In order to adapt from python2 to python3, I would like to  add a try-catch 
> block and catch all exceptions and return False:
> !image-2023-03-22-12-02-53-173.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@ambari.apache.org
For additional commands, e-mail: issues-h...@ambari.apache.org