fix_cm_config_file.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Licensed to Cloudera, Inc. under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. Cloudera, Inc. licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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. diff --git a/desktop/core/src/desktop/manage_entry.py b/desktop/core/src/desktop/manage_entry.py
  17. index e02436ff73..e9971df789 100644
  18. --- a/desktop/core/src/desktop/manage_entry.py
  19. +++ b/desktop/core/src/desktop/manage_entry.py
  20. @@ -41,6 +41,7 @@ def entry():
  21. from django.core.management.base import BaseCommand
  22. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'desktop.settings')
  23. + cm_config_file = '/etc/cloudera-scm-agent/config.ini'
  24. # What's the subcommand being run?
  25. # This code uses the same logic from django.core.management to handle command args
  26. @@ -57,7 +58,6 @@ def entry():
  27. "import_ldap_group", "import_ldap_user", "sync_ldap_users_and_groups", "useradmin_sync_with_unix" ]
  28. if subcommand in commands_req_db:
  29. #Check if this is a CM managed cluster
  30. - cm_config_file = '/etc/cloudera-scm-agent/config.ini'
  31. if os.path.isfile(cm_config_file) and "--cm-managed" not in sys.argv:
  32. if not "HUE_CONF_DIR" in os.environ:
  33. print "ALERT: This appears to be a CM Managed environment"