You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/03/06 19:57:05 UTC

[5/6] ambari git commit: AMBARI-9962. HostCleanup.py does not remove packages (dlysnichenko)

AMBARI-9962. HostCleanup.py does not remove packages (dlysnichenko)


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

Branch: refs/heads/branch-2.0.0
Commit: 71096fe6b2a06c5dd444c5f10a2b0ded256c7469
Parents: 9034c34
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Fri Mar 6 20:54:21 2015 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Fri Mar 6 20:56:41 2015 +0200

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/HostCleanup.py           | 2 +-
 .../src/test/python/resource_management/TestUserResource.py        | 2 +-
 ambari-common/src/main/python/ambari_commons/constants.py          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/71096fe6/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
index 3e7e83f..ca9bc41 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
@@ -477,7 +477,7 @@ class HostCleanup:
   # Run command as sudoer by default, if root no issues
   def run_os_command(self, cmd, runWithSudo=True):
     if runWithSudo:
-      cmd = AMBARI_SUDO_BINARY + cmd
+      cmd = "/var/lib/ambari-agent/"+AMBARI_SUDO_BINARY + " " + cmd
     logger.info('Executing command: ' + str(cmd))
     if type(cmd) == str:
       cmd = shlex.split(cmd)

http://git-wip-us.apache.org/repos/asf/ambari/blob/71096fe6/ambari-agent/src/test/python/resource_management/TestUserResource.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestUserResource.py b/ambari-agent/src/test/python/resource_management/TestUserResource.py
index c757361..3062881 100644
--- a/ambari-agent/src/test/python/resource_management/TestUserResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestUserResource.py
@@ -183,7 +183,7 @@ class TestUserResource(TestCase):
       user = User("mapred", action = "create", groups = ['1','2','3'], 
           shell = "/bin/bash")
 
-    popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', "ambari-sudo.sh  PATH=/bin -H -E usermod -G 1,2,3 -s /bin/bash mapred"], shell=False, preexec_fn=None, stderr=-2, stdout=5, bufsize=1, env={'PATH': '/bin'}, cwd=None)
+    popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', 'ambari-sudo.sh  PATH=/bin -H -E usermod -G 1,2,3,hadoop -s /bin/bash mapred'], shell=False, preexec_fn=None, stderr=-2, stdout=5, env={'PATH': '/bin'}, bufsize=1, cwd=None)
     self.assertEqual(popen_mock.call_count, 1)
 
   @patch.object(subprocess, "Popen")

http://git-wip-us.apache.org/repos/asf/ambari/blob/71096fe6/ambari-common/src/main/python/ambari_commons/constants.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/constants.py b/ambari-common/src/main/python/ambari_commons/constants.py
index b823b31..99ff679 100644
--- a/ambari-common/src/main/python/ambari_commons/constants.py
+++ b/ambari-common/src/main/python/ambari_commons/constants.py
@@ -18,4 +18,4 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
-AMBARI_SUDO_BINARY = "ambari-sudo.sh"
\ No newline at end of file
+AMBARI_SUDO_BINARY = "ambari-sudo.sh"