Github user denalex commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1235#discussion_r115548918
  
    --- Diff: ranger-plugin/scripts/enable-ranger-plugin.sh ---
    @@ -70,14 +70,47 @@ function get_ranger_password() {
       done
     }
     
    +# get property value from hawq-site.xml
    +function get_hawq_property() {
    +  local hawq_site_file="$GPHOME/etc/hawq-site.xml"
    +  tag=$1
    +
    +  if [ -f $hawq_site_file ] ; then
    +    value=`cat $hawq_site_file | tr '\n' ' ' | awk -F '<property>' '{ 
for(i = 1; i <= NF; i++) { print $i; } }' | grep $tag | sed -n 
's|.*<value>\(.*\)</value>.*|\1|p'`
    +  else
    +    value=''
    +  fi
    +}
    +
     function get_hawq_url() {
    -  #todo read hawq-site.xml ?
    +
    +  # get hawq master host and port
    +  # 1. read from command parameter -h
    +  # 2. read from hawq-site.xml
    +  if [[ -z "$HAWQ_URL" ]]; then
    +    value=''
    +    get_hawq_property hawq_master_address_host
    +    local host=$value
    --- End diff --
    
    if you have function's last line do echo $value, then here you can just say 
local host = $(func) instead of setting/resetting global variable


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to