-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30708/
-----------------------------------------------------------
(Updated Feb. 7, 2015, 1:16 a.m.)
Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Nate Cole, Tom
Beerbower, and Yurii Shylov.
Changes
-------
Added unit test.
Bugs: AMBARI-9507
https://issues.apache.org/jira/browse/AMBARI-9507
Repository: ambari
Description
-------
Prepare namenode failed during RU on Ubuntu12, retry does not help.
This is because ru_execute_task.py calls python directly, instead of the python
wrapper that appends several other directories to the PYTHONPATH environment
variable, which is needed by the module imports.
```
2015-02-03 03:11:47,374 - Task. Type: EXECUTE, Script: scripts/namenode.py -
Function: prepare_rolling_upgrade
2015-02-03 03:11:47,395 - call['python
/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
prepare_rolling_upgrade /var/lib/ambari-agent/data/command-274.json
/var/lib/ambari-agent/cache/custom_actions
/var/lib/ambari-agent/data/structured-out-274.json INFO
/var/lib/ambari-agent/data/tmp'] {}
2015-02-03 03:11:47,451 - Command: python
/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
prepare_rolling_upgrade /var/lib/ambari-agent/data/command-274.json
/var/lib/ambari-agent/cache/custom_actions
/var/lib/ambari-agent/data/structured-out-274.json INFO
/var/lib/ambari-agent/data/tmp
Code: 1, Out: Traceback (most recent call last):
File
"/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py",
line 24, in <module>
from resource_management import *
ImportError: No module named resource_management
2015-02-03 03:11:47,452 - Error while executing command 'actionexecute':
Traceback (most recent call last):
File
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
line 184, in execute
method(env)
File
"/var/lib/ambari-agent/cache/custom_actions/scripts/ru_execute_tasks.py", line
146, in actionexecute
raise Fail(out)
Fail: Traceback (most recent call last):
File
"/var/lib/ambari-agent/cache/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py",
line 24, in <module>
from resource_management import *
ImportError: No module named resource_management
```
Diffs (updated)
-----
ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
02c449f
ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
PRE-CREATION
ambari-server/src/test/resources/custom_actions/ru_execute_tasks_namenode_prepare.json
PRE-CREATION
Diff: https://reviews.apache.org/r/30708/diff/
Testing
-------
Verified that this works during a Rolling Upgrade on an Ubuntu cluster.
Unit tests are in progress.
Thanks,
Alejandro Fernandez