AMBARI-18368. Atlas web UI alert after performing stack upgrade to HDP 2.5 and adding Atlas Service (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a33e2b62 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a33e2b62 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a33e2b62 Branch: refs/heads/branch-dev-patch-upgrade Commit: a33e2b628f5e6f40377c0c8c8cc348dcfb6d2a6f Parents: 1b4a38d Author: Alejandro Fernandez <afernan...@hortonworks.com> Authored: Mon Sep 12 18:50:07 2016 -0700 Committer: Alejandro Fernandez <afernan...@hortonworks.com> Committed: Tue Sep 13 15:23:23 2016 -0700 ---------------------------------------------------------------------- .../ATLAS/0.1.0.2.3/package/scripts/metadata.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a33e2b62/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py index 0c07018..a568cb7 100644 --- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py +++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py @@ -17,9 +17,11 @@ See the License for the specific language governing permissions and limitations under the License. """ +import os + from resource_management import Package from resource_management import StackFeature -from resource_management.core.resources.system import Directory, File +from resource_management.core.resources.system import Directory, File, Execute from resource_management.core.source import StaticFile, InlineTemplate, Template from resource_management.core.exceptions import Fail from resource_management.libraries.functions.format import format @@ -94,6 +96,17 @@ def metadata(type='server'): mode=0755, content=InlineTemplate(params.metadata_env_content) ) + + files_to_chown = [format("{conf_dir}/policy-store.txt"), format("{conf_dir}/users-credentials.properties")] + for file in files_to_chown: + if os.path.exists(file): + Execute(('chown', format('{metadata_user}:{user_group}'), file), + sudo=True + ) + Execute(('chmod', '644', file), + sudo=True + ) + if params.metadata_solrconfig_content: File(format("{conf_dir}/solr/solrconfig.xml"), mode=0644,