params.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env python
  2. """
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. """
  17. from ambari_commons.os_check import OSCheck
  18. from resource_management.libraries.functions import format
  19. from resource_management.libraries.functions.version import format_hdp_stack_version
  20. from resource_management.libraries.functions.default import default
  21. from resource_management.libraries.functions import get_kinit_path
  22. from resource_management.libraries.script.script import Script
  23. if OSCheck.is_windows_family():
  24. from params_windows import *
  25. else:
  26. from params_linux import *
  27. host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
  28. # server configurations
  29. config = Script.get_config()
  30. stack_name = default("/hostLevelParams/stack_name", None)
  31. # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
  32. version = default("/commandParams/version", None)
  33. stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
  34. hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
  35. #hadoop params
  36. slider_bin_dir = "/usr/lib/slider/bin"
  37. if Script.is_hdp_stack_greater_or_equal("2.2"):
  38. slider_bin_dir = '/usr/hdp/current/slider-client/bin'
  39. hadoop_conf_dir = "/usr/hdp/current/hadoop-client/conf"
  40. slider_conf_dir = "/usr/hdp/current/slider-client/conf"
  41. smokeuser = config['configurations']['cluster-env']['smokeuser']
  42. smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
  43. security_enabled = config['configurations']['cluster-env']['security_enabled']
  44. smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
  45. kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
  46. slider_env_sh_template = config['configurations']['slider-env']['content']
  47. java64_home = config['hostLevelParams']['java_home']
  48. log4j_props = config['configurations']['slider-log4j']['content']
  49. slider_cmd = format("{slider_bin_dir}/slider")