Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 99496200D4F for ; Wed, 6 Dec 2017 13:16:29 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9824B160C08; Wed, 6 Dec 2017 12:16:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DCE9E160BFD for ; Wed, 6 Dec 2017 13:16:28 +0100 (CET) Received: (qmail 79564 invoked by uid 500); 6 Dec 2017 12:16:28 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 79555 invoked by uid 99); 6 Dec 2017 12:16:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Dec 2017 12:16:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E29A1DFFAB; Wed, 6 Dec 2017 12:16:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-22596. Ambari Builds Are Failing With Python Test Errors (aonishuk) Date: Wed, 6 Dec 2017 12:16:27 +0000 (UTC) archived-at: Wed, 06 Dec 2017 12:16:29 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.6 8de808b78 -> f52e5f93e AMBARI-22596. Ambari Builds Are Failing With Python Test Errors (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f52e5f93 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f52e5f93 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f52e5f93 Branch: refs/heads/branch-2.6 Commit: f52e5f93effdaaceb13a3f8d201b26e052f559c1 Parents: 8de808b Author: Andrew Onishuk Authored: Wed Dec 6 14:16:18 2017 +0200 Committer: Andrew Onishuk Committed: Wed Dec 6 14:16:18 2017 +0200 ---------------------------------------------------------------------- ambari-server/src/test/python/TestAmbariServer.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f52e5f93/ambari-server/src/test/python/TestAmbariServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py index a53d274..fcca111 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/ambari-server/src/test/python/TestAmbariServer.py @@ -132,6 +132,17 @@ with patch.object(platform, "linux_distribution", return_value = MagicMock(retur CURR_AMBARI_VERSION = "2.0.0" +def restore_sys_argv(fn): + def wrapped(*args, **kwargs): + old_sys_argv = sys.argv + try: + sys.argv = [] + return fn(*args, **kwargs) + finally: + sys.argv = old_sys_argv + + return wrapped + @patch.object(platform, "linux_distribution", new = MagicMock(return_value=('Redhat', '6.4', 'Final'))) @patch("ambari_server.dbConfiguration_linux.get_postgre_hba_dir", new = MagicMock(return_value = "/var/lib/pgsql/data")) @patch("ambari_server.dbConfiguration_linux.get_postgre_running_status", new = MagicMock(return_value = "running")) @@ -7987,6 +7998,7 @@ class TestAmbariServer(TestCase): self.assertEqual(None, result) pass + @restore_sys_argv @not_for_platform(PLATFORM_WINDOWS) @patch("ambari_server.serverConfiguration.write_property") @patch("ambari_server.serverConfiguration.get_ambari_properties")