|
@@ -17,19 +17,21 @@ See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
limitations under the License.
|
|
|
|
|
|
"""
|
|
"""
|
|
-
|
|
|
|
|
|
+from resource_management.libraries.script import Script
|
|
from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
|
|
from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
|
|
-from resource_management import *
|
|
|
|
|
|
+from resource_management.libraries.functions.format import format
|
|
|
|
+from resource_management.libraries.functions.default import default
|
|
|
|
|
|
config = Script.get_config()
|
|
config = Script.get_config()
|
|
tmp_dir = Script.get_tmp_dir()
|
|
tmp_dir = Script.get_tmp_dir()
|
|
|
|
|
|
-hdp_stack_version = str(config['hostLevelParams']['stack_version'])
|
|
|
|
-hdp_stack_version = format_hdp_stack_version(hdp_stack_version)
|
|
|
|
-stack_is_hdp22_or_further = hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0
|
|
|
|
-
|
|
|
|
-version = default("/commandParams/version", None)
|
|
|
|
stack_name = default("/hostLevelParams/stack_name", None)
|
|
stack_name = default("/hostLevelParams/stack_name", None)
|
|
|
|
+version = default("/commandParams/version", None)
|
|
|
|
+
|
|
|
|
+stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
|
|
|
|
+hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
|
|
|
|
+
|
|
|
|
+stack_is_hdp22_or_further = hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0
|
|
|
|
|
|
if stack_is_hdp22_or_further:
|
|
if stack_is_hdp22_or_further:
|
|
ranger_home = '/usr/hdp/current/ranger-admin'
|
|
ranger_home = '/usr/hdp/current/ranger-admin'
|
|
@@ -39,8 +41,6 @@ if stack_is_hdp22_or_further:
|
|
usersync_home = '/usr/hdp/current/ranger-usersync'
|
|
usersync_home = '/usr/hdp/current/ranger-usersync'
|
|
usersync_start = '/usr/bin/ranger-usersync-start'
|
|
usersync_start = '/usr/bin/ranger-usersync-start'
|
|
usersync_stop = '/usr/bin/ranger-usersync-stop'
|
|
usersync_stop = '/usr/bin/ranger-usersync-stop'
|
|
-else:
|
|
|
|
- pass
|
|
|
|
|
|
|
|
java_home = config['hostLevelParams']['java_home']
|
|
java_home = config['hostLevelParams']['java_home']
|
|
unix_user = default("/configurations/ranger-env/ranger_user", "ranger")
|
|
unix_user = default("/configurations/ranger-env/ranger_user", "ranger")
|