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

Qiang Zhang updated RANGER-1293:
--------------------------------
    Description: 
There were logic errors in create_rangerdb_user and grant_xa_db_user function.
The reason for the error is that the hosts_arr variable was set ["%", 
"localhost"] as default value at the beginning. The hosts_arr variable will 
include two localhost values if self.host equal to localhost. As a result, the 
back code block will be executed repeatedly, the performance of the program 
will be reduced. The error code is following:
hosts_arr =["%", "localhost"]
hosts_arr.append(self.host)
for host in hosts_arr:
    business logic code block
>From the above code logic we can be seen that the business logic code block 
>will be repeated twice when the db_host attribute is set to localhost in 
>install.properties.

  was:
In the MysqlConf class of security-admin/scripts/dba_script.py, the 
create_rangerdb_user and grant_xa_db_user function have following problem:
At the beginning the hosts_arr variable was set ["%", "localhost"] as default 
value. The hosts_arr variable will include two localhost values if self.host 
equal to localhost. As a result, the back code segment will be executed 
repeatedly, And the performance of the program will be reduced.

        Summary: There were logic errors in create_rangerdb_user and 
grant_xa_db_user function.  (was: In the MysqlConf class of 
security-admin/scripts/dba_script.py, the create_rangerdb_user and 
grant_xa_db_user function  have a problem.)

> There were logic errors in create_rangerdb_user and grant_xa_db_user function.
> ------------------------------------------------------------------------------
>
>                 Key: RANGER-1293
>                 URL: https://issues.apache.org/jira/browse/RANGER-1293
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>            Reporter: Qiang Zhang
>            Assignee: Qiang Zhang
>            Priority: Minor
>              Labels: patch
>         Attachments: 
> 0001-RANGER-1293-the-create_rangerdb_user-and-grant_xa_db.patch
>
>
> There were logic errors in create_rangerdb_user and grant_xa_db_user function.
> The reason for the error is that the hosts_arr variable was set ["%", 
> "localhost"] as default value at the beginning. The hosts_arr variable will 
> include two localhost values if self.host equal to localhost. As a result, 
> the back code block will be executed repeatedly, the performance of the 
> program will be reduced. The error code is following:
> hosts_arr =["%", "localhost"]
> hosts_arr.append(self.host)
> for host in hosts_arr:
>     business logic code block
> From the above code logic we can be seen that the business logic code block 
> will be repeated twice when the db_host attribute is set to localhost in 
> install.properties.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to