You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Andrew Onischuk <ao...@hortonworks.com> on 2017/06/06 10:45:36 UTC

Review Request 59835: Agent Host Disk Usage Alert Hardcodes the Stack Directory

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59835/
-----------------------------------------------------------

Review request for Ambari and Vitalyi Brodetskyi.


Bugs: AMBARI-21182
    https://issues.apache.org/jira/browse/AMBARI-21182


Repository: ambari


Description
-------

The Host Disk Usage alert currently hard codes the stack location directly
into the script:

    
    
    
    # the location where HDP installs components when using HDP 2.2+
    STACK_HOME_DIR = "/usr/hdp"
    # the location where HDP installs components when using HDP 2.0 to 2.1
    STACK_HOME_LEGACY_DIR = "/usr/lib"
    # determine the location of HDP home
      stack_home = None
      if os.path.isdir(STACK_HOME_DIR):
        stack_home = STACK_HOME_DIR
      elif os.path.isdir(STACK_HOME_LEGACY_DIR):
        stack_home = STACK_HOME_LEGACY_DIR
    

On clusters where a different stack is installed (such as `/usr/hdf`, the
above logic incorrectly checks the `STACK_HOME_LEGACY_DIR`.

  * The 2.0 and 2.1 code paths should be removed since they are not supported anymore.
  * We should parameterize STACK_HOME_DIR (or even better, use the stack features JSON structure) to determine the home location to check.


Diffs
-----

  ambari-server/src/main/resources/host_scripts/alert_disk_space.py d2b4f36 


Diff: https://reviews.apache.org/r/59835/diff/1/


Testing
-------

mvn clean test


Thanks,

Andrew Onischuk


Re: Review Request 59835: Agent Host Disk Usage Alert Hardcodes the Stack Directory

Posted by Dmytro Grinenko <ha...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59835/#review177020
-----------------------------------------------------------


Ship it!




Ship It!

- Dmytro Grinenko


On June 6, 2017, 10:45 a.m., Andrew Onischuk wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59835/
> -----------------------------------------------------------
> 
> (Updated June 6, 2017, 10:45 a.m.)
> 
> 
> Review request for Ambari and Vitalyi Brodetskyi.
> 
> 
> Bugs: AMBARI-21182
>     https://issues.apache.org/jira/browse/AMBARI-21182
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> The Host Disk Usage alert currently hard codes the stack location directly
> into the script:
> 
>     
>     
>     
>     # the location where HDP installs components when using HDP 2.2+
>     STACK_HOME_DIR = "/usr/hdp"
>     # the location where HDP installs components when using HDP 2.0 to 2.1
>     STACK_HOME_LEGACY_DIR = "/usr/lib"
>     # determine the location of HDP home
>       stack_home = None
>       if os.path.isdir(STACK_HOME_DIR):
>         stack_home = STACK_HOME_DIR
>       elif os.path.isdir(STACK_HOME_LEGACY_DIR):
>         stack_home = STACK_HOME_LEGACY_DIR
>     
> 
> On clusters where a different stack is installed (such as `/usr/hdf`, the
> above logic incorrectly checks the `STACK_HOME_LEGACY_DIR`.
> 
>   * The 2.0 and 2.1 code paths should be removed since they are not supported anymore.
>   * We should parameterize STACK_HOME_DIR (or even better, use the stack features JSON structure) to determine the home location to check.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/resources/host_scripts/alert_disk_space.py d2b4f36 
> 
> 
> Diff: https://reviews.apache.org/r/59835/diff/1/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Andrew Onischuk
> 
>