You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/05/12 20:13:50 UTC
ambari git commit: AMBARI-11076. Atlas Install fails with war error
(Jon Maron via smohanty)
Repository: ambari
Updated Branches:
refs/heads/trunk fa1303aaa -> 2dcf4f310
AMBARI-11076. Atlas Install fails with war error (Jon Maron via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2dcf4f31
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2dcf4f31
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2dcf4f31
Branch: refs/heads/trunk
Commit: 2dcf4f3107da6c58bba68308163ea79cead04b09
Parents: fa1303a
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Tue May 12 11:13:01 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue May 12 11:13:01 2015 -0700
----------------------------------------------------------------------
.../ATLAS/0.1.0.2.3/package/scripts/metadata.py | 9 ---------
.../ATLAS/0.1.0.2.3/package/scripts/metadata_server.py | 13 ++++++++++++-
.../python/stacks/2.3/ATLAS/test_metadata_server.py | 11 ++++++-----
3 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2dcf4f31/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 a4274ca..61cdec4 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,8 +17,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
-import os
-import shutil
from resource_management import Directory, Fail, Logger, File, \
InlineTemplate, StaticFile
from resource_management.libraries.functions import format
@@ -67,13 +65,6 @@ def metadata():
recursive=True
)
- metadata_war_file = format('{params.metadata_home}/server/webapp/metadata.war')
- if not os.path.isfile(metadata_war_file):
- raise Fail("Unable to copy {0} because it does not exist".format(metadata_war_file))
-
- Logger.info("Copying {0} to {1}".format(metadata_war_file, params.expanded_war_dir))
- shutil.copy2(metadata_war_file, params.expanded_war_dir)
-
File(format('{conf_dir}/application.properties'),
content=InlineTemplate(params.application_properties_content),
mode=0644,
http://git-wip-us.apache.org/repos/asf/ambari/blob/2dcf4f31/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
index 94a8f9e..2484315 100644
--- a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
+++ b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
@@ -16,9 +16,12 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
+import os
+import shutil
from metadata import metadata
-from resource_management import Execute, check_process_status, Script
+from resource_management import Execute, check_process_status, Script, Fail, \
+ Logger
from resource_management.libraries.functions import format
class MetadataServer(Script):
@@ -43,6 +46,14 @@ class MetadataServer(Script):
def start(self, env, rolling_restart=False):
import params
env.set_params(params)
+
+ metadata_war_file = format('{params.metadata_home}/server/webapp/metadata.war')
+ if not os.path.isfile(metadata_war_file):
+ raise Fail("Unable to copy {0} because it does not exist".format(metadata_war_file))
+
+ Logger.info("Copying {0} to {1}".format(metadata_war_file, params.expanded_war_dir))
+ shutil.copy2(metadata_war_file, params.expanded_war_dir)
+
daemon_cmd = format('source {params.conf_dir}/metadata-env.sh ; {params.metadata_start_script} --port {params.metadata_port}')
no_op_test = format('ls {params.pid_file} >/dev/null 2>&1 && ps -p `cat {params.pid_file}` >/dev/null 2>&1')
Execute(daemon_cmd,
http://git-wip-us.apache.org/repos/asf/ambari/blob/2dcf4f31/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
index 90df616..6f1377b 100644
--- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
@@ -28,10 +28,7 @@ class TestMetadataServer(RMFTestCase):
COMMON_SERVICES_PACKAGE_DIR = "ATLAS/0.1.0.2.3/package"
STACK_VERSION = "2.3"
- @patch("shutil.copy2", new = MagicMock())
- @patch("os.path.isfile")
- def test_configure_default(self, isfile_mock):
- isfile_mock.return_value = True
+ def test_configure_default(self):
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/metadata_server.py",
classname = "MetadataServer",
@@ -96,7 +93,11 @@ class TestMetadataServer(RMFTestCase):
)
self.assertNoMoreResources()
- def test_start_default(self):
+ @patch("shutil.copy2", new = MagicMock())
+ @patch("os.path.isfile")
+ def test_start_default(self, isfile_mock):
+ isfile_mock.return_value = True
+
self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/metadata_server.py",
classname = "MetadataServer",
command = "start",