You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2018/08/06 21:34:12 UTC
[ambari] branch branch-2.7 updated: AMBARI-24409. Infra Solr
migration: Restore collection fails after EU on Custom Users + WE cluster.
Error - Permission denied: u'/tmp/ranger/restore_core_pairs.json' (#1975)
This is an automated email from the ASF dual-hosted git repository.
oleewere pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new e95d537 AMBARI-24409. Infra Solr migration: Restore collection fails after EU on Custom Users + WE cluster. Error - Permission denied: u'/tmp/ranger/restore_core_pairs.json' (#1975)
e95d537 is described below
commit e95d537b5339ea871d3860ddaddf9ff485c80f08
Author: Olivér Szabó <ol...@gmail.com>
AuthorDate: Mon Aug 6 23:34:10 2018 +0200
AMBARI-24409. Infra Solr migration: Restore collection fails after EU on Custom Users + WE cluster. Error - Permission denied: u'/tmp/ranger/restore_core_pairs.json' (#1975)
---
.../AMBARI_INFRA_SOLR/0.1.0/package/scripts/command_commons.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/command_commons.py b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/command_commons.py
index e9119c9..311fc0a 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/command_commons.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA_SOLR/0.1.0/package/scripts/command_commons.py
@@ -26,7 +26,7 @@ import traceback
from resource_management.core.shell import call
from resource_management.core.logger import Logger
-from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import Execute, File
from resource_management.libraries.functions.default import default
from resource_management.libraries.functions.format import format
from resource_management.libraries.resources.hdfs_resource import HdfsResource
@@ -267,8 +267,7 @@ def __get_domain_name(url):
def write_core_file(core, core_data):
core_json_location = format("{index_location}/{core}.json")
- with open(core_json_location, 'w') as outfile:
- json.dump(core_data, outfile)
+ File(core_json_location, content=json.dumps(core_data))
def create_core_pairs(original_cores, new_cores):
"""
@@ -286,8 +285,7 @@ def create_core_pairs(original_cores, new_cores):
value['target_core']=new_cores[index][0]
value['target_host']=new_cores[index][1]
core_pairs_data.append(value)
- with open(format("{index_location}/restore_core_pairs.json"), 'w') as outfile:
- json.dump(core_pairs_data, outfile)
+ File(format("{index_location}/restore_core_pairs.json"), content=json.dumps(core_pairs_data))
return core_pairs_data
def sort_core_host_pairs(host_core_map):