ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-14950. EU: Oozie service check failed after downgrade with multiple Oozie servers since rerunning prepare-war removes webapps/oozie folder (alejandro)
Date Mon, 08 Feb 2016 20:18:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 32b3ee9c1 -> 631cc8c96


AMBARI-14950. EU: Oozie service check failed after downgrade with multiple Oozie servers since
rerunning prepare-war removes webapps/oozie folder (alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/631cc8c9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/631cc8c9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/631cc8c9

Branch: refs/heads/branch-2.2
Commit: 631cc8c967d210bceb88b0a6778b2f4e904be581
Parents: 32b3ee9
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Mon Feb 8 12:10:57 2016 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Mon Feb 8 12:17:57 2016 -0800

----------------------------------------------------------------------
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py    |  71 ++++++++++--
 .../4.0.0.2.0/package/scripts/oozie_server.py   |   3 +-
 .../package/scripts/oozie_server_upgrade.py     |  18 +--
 .../stacks/2.0.6/OOZIE/test_oozie_server.py     | 112 ++++++++++---------
 4 files changed, 123 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/631cc8c9/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 5d6ae99..be4a191 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -32,10 +32,15 @@ from resource_management.libraries.script.script import Script
 from resource_management.core.resources.packaging import Package
 from resource_management.core.shell import as_user
 from resource_management.core.shell import as_sudo
+from resource_management.core import shell
+from resource_management.core.exceptions import Fail
+from resource_management.core.logger import Logger
+
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons import OSConst
 from ambari_commons.inet_utils import download_file
 
+
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
 def oozie(is_server=False):
   import params
@@ -191,7 +196,59 @@ def oozie_ownership():
     owner = params.oozie_user,
     group = params.user_group
   )
-  
+
+
+def prepare_war():
+  """
+  Attempt to call prepare-war command if the marker file doesn't exist or its content doesn't
equal the expected command.
+  The marker file is stored in /usr/hdp/current/oozie-server/.prepare_war_cmd
+  """
+  import params
+
+  prepare_war_cmd_file = format("{oozie_home}/.prepare_war_cmd")
+
+  # DON'T CHANGE THE VALUE SINCE IT'S USED TO DETERMINE WHETHER TO RUN THE COMMAND OR NOT
BY READING THE MARKER FILE.
+  # Oozie tmp dir should be /var/tmp/oozie and is already created by a function above.
+  command = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war {oozie_secure}")
+  command = command.strip()
+
+  run_prepare_war = False
+  if os.path.exists(prepare_war_cmd_file):
+    cmd = ""
+    with open(prepare_war_cmd_file, "r") as f:
+      cmd = f.readline().strip()
+
+    if command != cmd:
+      run_prepare_war = True
+      Logger.info(format("Will run prepare war cmd since marker file {prepare_war_cmd_file}
has contents which differ.\n" \
+      "Expected: {command}.\nActual: {cmd}."))
+  else:
+    run_prepare_war = True
+    Logger.info(format("Will run prepare war cmd since marker file {prepare_war_cmd_file}
is missing."))
+
+  if run_prepare_war:
+    # Time-consuming to run
+    Execute(command,
+            user=params.oozie_user
+    )
+
+    return_code, output = shell.call(command, user=params.oozie_user, logoutput=False, quiet=False)
+    if output is None:
+      output = ""
+
+    if return_code != 0 or "New Oozie WAR file with added".lower() not in output.lower():
+      message = "Unexpected Oozie WAR preparation output {0}".format(output)
+      Logger.error(message)
+      raise Fail(message)
+
+    # Generate marker file
+    File(prepare_war_cmd_file,
+         content=command,
+         mode=0644,
+    )
+  else:
+    Logger.info(format("No need to run prepare-war since marker file {prepare_war_cmd_file}
already exists."))
+
 def oozie_server_specific():
   import params
   
@@ -253,22 +310,12 @@ def oozie_server_specific():
       not_if  = no_op_test,
     )
 
-  prepare_war_cmd_file = format("{oozie_home}/.prepare_war_cmd")
-  prepare_war_cmd = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war {oozie_secure}")
-  skip_prepare_war_cmd = format("test -f {prepare_war_cmd_file} && [[ `cat {prepare_war_cmd_file}`
== '{prepare_war_cmd}' ]]")
+  prepare_war()
 
-  Execute(prepare_war_cmd,    # time-expensive
-    user = params.oozie_user,
-    not_if  = format("{no_op_test} || {skip_recreate_sharelib} && {skip_prepare_war_cmd}")
-  )
   File(hashcode_file,
        content = hashcode,
        mode = 0644,
   )
-  File(prepare_war_cmd_file,
-       content = prepare_war_cmd,
-       mode = 0644,
-  )
 
   if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2')
>= 0:
     # Create hive-site and tez-site configs for oozie

http://git-wip-us.apache.org/repos/asf/ambari/blob/631cc8c9/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
index 35975df..dc00b13 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server.py
@@ -39,7 +39,8 @@ from oozie_service import oozie_service
 from oozie_server_upgrade import OozieUpgrade
 
 from check_oozie_server_status import check_oozie_server_status
-         
+
+
 class OozieServer(Script):
 
   def get_stack_to_component(self):

http://git-wip-us.apache.org/repos/asf/ambari/blob/631cc8c9/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
index 326e76c..4d68f03 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
@@ -199,23 +199,7 @@ class OozieUpgrade(Script):
       command = format("{kinit_path_local} -kt {oozie_keytab} {oozie_principal_with_host}")
       Execute(command, user=params.oozie_user, logoutput=True)
 
-    # setup environment
-    environment = { "CATALINA_BASE" : "/usr/hdp/current/oozie-server/oozie-server",
-      "OOZIE_HOME" : "/usr/hdp/current/oozie-server" }
-
-    # prepare the oozie WAR
-    command = format("{oozie_setup_sh} prepare-war {oozie_secure} -d {oozie_libext_dir}")
-    return_code, oozie_output = shell.call(command, user=params.oozie_user,
-      logoutput=False, quiet=False, env=environment)
-
-    # set it to "" in to prevent a possible iteration issue
-    if oozie_output is None:
-      oozie_output = ""
-
-    if return_code != 0 or "New Oozie WAR file with added".lower() not in oozie_output.lower():
-      message = "Unexpected Oozie WAR preparation output {0}".format(oozie_output)
-      Logger.error(message)
-      raise Fail(message)
+    oozie.prepare_war()
 
 
   def upgrade_oozie_database_and_sharelib(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/631cc8c9/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index c179c52..826a004 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -43,25 +43,30 @@ class TestOozieServer(RMFTestCase):
   def setUp(self):
     self.maxDiff = None
 
-  def test_configure_default(self):
+  @patch.object(shell, "call")
+  def test_configure_default(self, call_mocks):
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                        classname = "OozieServer",
                        command = "configure",
                        config_file="default.json",
                        hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       target = RMFTestCase.TARGET_COMMON_SERVICES,
+                       call_mocks = call_mocks
     )
     self.assert_configure_default()
     self.assertNoMoreResources()
 
-
-  def test_configure_default_mysql(self):
+  @patch.object(shell, "call")
+  def test_configure_default_mysql(self, call_mocks):
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                        classname = "OozieServer",
                        command = "configure",
                        config_file="default_oozie_mysql.json",
                        hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       target = RMFTestCase.TARGET_COMMON_SERVICES,
+                       call_mocks = call_mocks
     )
     self.assertResourceCalled('HdfsResource', '/user/oozie',
         security_enabled = False,
@@ -249,30 +254,32 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'ambari-sudo.sh chown oozie:hadoop /usr/lib/oozie/libext/falcon-oozie-el-extension-*.jar',
         not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1'",
     )
-    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ',
-        not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1' || test -f /usr/lib/oozie/.hashcode && test -d /usr/lib/oozie/share
&& [[ `cat /usr/lib/oozie/.hashcode` == 'abc123hash' ]] && test -f /usr/lib/oozie/.prepare_war_cmd
&& [[ `cat /usr/lib/oozie/.prepare_war_cmd` == 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ' ]]",
-        user = 'oozie',
-    )
-    self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
-        content = 'abc123hash',
-        mode = 0644,
+
+    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
+                              user = "oozie"
     )
     self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
-        content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh prepare-war
',
-        mode = 0644,
+                              content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
+                              mode = 0644,
+    )
+    self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
+                              content = 'abc123hash',
+                              mode = 0644,
     )
     self.assertResourceCalled('Execute', ('chown', '-R', 'oozie:hadoop', '/var/lib/oozie/oozie-server'),
         sudo = True,
     )
 
-
-  def test_configure_existing_sqla(self):
+  @patch.object(shell, "call")
+  def test_configure_existing_sqla(self, call_mocks):
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                        classname = "OozieServer",
                        command = "configure",
                        config_file="oozie_existing_sqla.json",
                        hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       target = RMFTestCase.TARGET_COMMON_SERVICES,
+                       call_mocks = call_mocks
     )
     self.assertResourceCalled('HdfsResource', '/user/oozie',
                               security_enabled = False,
@@ -465,16 +472,15 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'ambari-sudo.sh chown oozie:hadoop /usr/lib/oozie/libext/falcon-oozie-el-extension-*.jar',
                               not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1'",
                               )
-    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ',
-                              not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1' || test -f /usr/lib/oozie/.hashcode && test -d /usr/lib/oozie/share
&& [[ `cat /usr/lib/oozie/.hashcode` == 'abc123hash' ]] && test -f /usr/lib/oozie/.prepare_war_cmd
&& [[ `cat /usr/lib/oozie/.prepare_war_cmd` == 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ' ]]",
+    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
                               user = 'oozie',
                               )
-    self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
-                              content = 'abc123hash',
+    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
+                              content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
                               mode = 0644,
                               )
-    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
-                              content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ',
+    self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
+                              content = 'abc123hash',
                               mode = 0644,
                               )
     self.assertResourceCalled('Execute', ('chown', '-R', u'oozie:hadoop', '/var/lib/oozie/oozie-server'),
@@ -482,16 +488,18 @@ class TestOozieServer(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
-
+  @patch.object(shell, "call")
   @patch("os.path.isfile")
-  def test_start_default(self, isfile_mock):
+  def test_start_default(self, isfile_mock, call_mocks):
     isfile_mock.return_value = True
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                          classname = "OozieServer",
                          command = "start",
                          config_file="default.json",
                          hdp_stack_version = self.STACK_VERSION,
-                         target = RMFTestCase.TARGET_COMMON_SERVICES
+                         target = RMFTestCase.TARGET_COMMON_SERVICES,
+                         call_mocks = call_mocks
         )
     self.assert_configure_default()
     self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/ooziedb.sh
create -sqlfile oozie.sql -run',
@@ -537,7 +545,6 @@ class TestOozieServer(RMFTestCase):
     )
     self.assertNoMoreResources()
 
-
   def test_stop_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                          classname = "OozieServer",
@@ -556,27 +563,32 @@ class TestOozieServer(RMFTestCase):
     )
     self.assertNoMoreResources()
 
-
-  def test_configure_secured(self):
+  @patch.object(shell, "call")
+  def test_configure_secured(self, call_mocks):
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                        classname = "OozieServer",
                        command = "configure",
                        config_file="secured.json",
                        hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES
+                       target = RMFTestCase.TARGET_COMMON_SERVICES,
+                       call_mocks = call_mocks
     )
     self.assert_configure_secured()
     self.assertNoMoreResources()
 
+  @patch.object(shell, "call")
   @patch("os.path.isfile")
-  def test_start_secured(self, isfile_mock):
+  def test_start_secured(self, isfile_mock, call_mocks):
     isfile_mock.return_value = True
+    call_mocks = MagicMock(return_value=(0, "New Oozie WAR file with added"))
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/oozie_server.py",
                          classname = "OozieServer",
                          command = "start",
                          config_file="secured.json",
                          hdp_stack_version = self.STACK_VERSION,
-                         target = RMFTestCase.TARGET_COMMON_SERVICES
+                         target = RMFTestCase.TARGET_COMMON_SERVICES,
+                         call_mocks = call_mocks
     )
     self.assert_configure_secured()
     self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/ooziedb.sh
create -sqlfile oozie.sql -run',
@@ -644,7 +656,6 @@ class TestOozieServer(RMFTestCase):
     )
     self.assertNoMoreResources()
 
-
   def assert_configure_default(self):
     self.assertResourceCalled('HdfsResource', '/user/oozie',
         security_enabled = False,
@@ -814,23 +825,22 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'ambari-sudo.sh chown oozie:hadoop /usr/lib/oozie/libext/falcon-oozie-el-extension-*.jar',
         not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1'",
     )
-    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ',
-        not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1' || test -f /usr/lib/oozie/.hashcode && test -d /usr/lib/oozie/share
&& [[ `cat /usr/lib/oozie/.hashcode` == 'abc123hash' ]] && test -f /usr/lib/oozie/.prepare_war_cmd
&& [[ `cat /usr/lib/oozie/.prepare_war_cmd` == 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war ' ]]",
-        user = 'oozie',
+
+    self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
+                              user="oozie")
+
+    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
+                              content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
-        content = 'abc123hash',
-        mode = 0644,
-    )
-    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
-        content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh prepare-war
',
-        mode = 0644,
+                              content = 'abc123hash',
+                              mode = 0644,
     )
     self.assertResourceCalled('Execute', ('chown', '-R', 'oozie:hadoop', '/var/lib/oozie/oozie-server'),
         sudo = True,
     )
 
-
   def assert_configure_secured(self):
     self.assertResourceCalled('HdfsResource', '/user/oozie',
         security_enabled = True,
@@ -1002,17 +1012,17 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', 'ambari-sudo.sh chown oozie:hadoop /usr/lib/oozie/libext/falcon-oozie-el-extension-*.jar',
         not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1'",
     )
+
     self.assertResourceCalled('Execute', 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war -secure',
-        not_if = "ambari-sudo.sh su oozie -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]ls
/var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p `cat /var/run/oozie/oozie.pid`
>/dev/null 2>&1' || test -f /usr/lib/oozie/.hashcode && test -d /usr/lib/oozie/share
&& [[ `cat /usr/lib/oozie/.hashcode` == 'abc123hash' ]] && test -f /usr/lib/oozie/.prepare_war_cmd
&& [[ `cat /usr/lib/oozie/.prepare_war_cmd` == 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war -secure' ]]",
-        user = 'oozie',
+                              user="oozie")
+
+    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
+                              content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh
prepare-war -secure',
+                              mode = 0644,
     )
     self.assertResourceCalled('File', '/usr/lib/oozie/.hashcode',
-        content = 'abc123hash',
-        mode = 0644,
-    )
-    self.assertResourceCalled('File', '/usr/lib/oozie/.prepare_war_cmd',
-        content = 'cd /var/tmp/oozie && /usr/lib/oozie/bin/oozie-setup.sh prepare-war
-secure',
-        mode = 0644,
+                              content = 'abc123hash',
+                              mode = 0644,
     )
     self.assertResourceCalled('Execute', ('chown', '-R', 'oozie:hadoop', '/var/lib/oozie/oozie-server'),
         sudo = True,


Mime
View raw message