ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Lenoel" <romain.len...@worldline.com>
Subject Review Request 31620: Exception during after-INSTALL hook (HDP 2.0.6) if stack version contains letters
Date Mon, 02 Mar 2015 09:47:03 GMT

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

Review request for Ambari.


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


Repository: ambari


Description
-------

When trying to install a stack named "2.2.XXX" which simply extends HDP-2.2 (and so 2.0.6),
the following exception is raised :

```
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/hook.py",
line 35, in <module>
    AfterInstallHook().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
line 208, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/hook.py",
line 31, in hook
    setup_hdp_install_directory()
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py",
line 26, in setup_hdp_install_directory
    if params.hdp_stack_version != "" and compare_versions(params.stack_version_unformatted,
'2.2') >= 0:
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/version.py",
line 73, in compare_versions
    return cmp(_normalize(version1, desired_segments=max_segments), _normalize(version2, desired_segments=max_segments))
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/version.py",
line 34, in _normalize
    return [int(x) for x in v_list]
ValueError: invalid literal for int() with base 10: 'XXX'
```

The exception raises because of the use of the unformatted version name in the following code

```
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py",
line 26, in setup_hdp_install_directory
    if params.hdp_stack_version != "" and compare_versions(params.stack_version_unformatted,
'2.2') >= 0
```


Diffs
-----

  ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
3b7bc54 

Diff: https://reviews.apache.org/r/31620/diff/


Testing
-------


Thanks,

Romain Lenoel


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message