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 2B626200B45 for ; Fri, 1 Jul 2016 02:02:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A607160A52; Fri, 1 Jul 2016 00:02:03 +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 7B294160A63 for ; Fri, 1 Jul 2016 02:02:02 +0200 (CEST) Received: (qmail 24557 invoked by uid 500); 1 Jul 2016 00:02:01 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 24540 invoked by uid 99); 1 Jul 2016 00:02:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2016 00:02:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4461F187827 for ; Fri, 1 Jul 2016 00:02:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id BxZxeHHlu7jg for ; Fri, 1 Jul 2016 00:01:59 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B34D35FCF7 for ; Fri, 1 Jul 2016 00:01:58 +0000 (UTC) Received: (qmail 24427 invoked by uid 99); 1 Jul 2016 00:01:58 -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; Fri, 01 Jul 2016 00:01:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E143DE03E8; Fri, 1 Jul 2016 00:01:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: robertwb@apache.org To: commits@beam.incubator.apache.org Date: Fri, 01 Jul 2016 00:01:59 -0000 Message-Id: <6441d6f342b645f4a01d9a9125594832@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/4] incubator-beam git commit: Replace call() with check_call() archived-at: Fri, 01 Jul 2016 00:02:03 -0000 Replace call() with check_call() Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/5fe6d7bf Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/5fe6d7bf Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/5fe6d7bf Branch: refs/heads/python-sdk Commit: 5fe6d7bf4c5cd8bb7b94fc55910a4cb2aee9462a Parents: 33720ec Author: Silviu Calinoiu Authored: Thu Jun 30 15:49:56 2016 -0700 Committer: Robert Bradshaw Committed: Thu Jun 30 17:00:11 2016 -0700 ---------------------------------------------------------------------- sdks/python/apache_beam/utils/dependency.py | 27 ++++++------------------ 1 file changed, 6 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/5fe6d7bf/sdks/python/apache_beam/utils/dependency.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/dependency.py b/sdks/python/apache_beam/utils/dependency.py index c52a5b7..7d9bd10 100644 --- a/sdks/python/apache_beam/utils/dependency.py +++ b/sdks/python/apache_beam/utils/dependency.py @@ -81,10 +81,7 @@ def _dependency_file_copy(from_path, to_path): if from_path.startswith('gs://') or to_path.startswith('gs://'): command_args = ['gsutil', '-m', '-q', 'cp', from_path, to_path] logging.info('Executing command: %s', command_args) - result = processes.call(command_args) - if result != 0: - raise ValueError( - 'Failed to copy GCS file from %s to %s.' % (from_path, to_path)) + processes.check_call(command_args) else: # Branch used only for unit tests and integration tests. # In such environments GCS support is not available. @@ -199,11 +196,7 @@ def _populate_requirements_cache(requirements_file, cache_dir): # Download from PyPI source distributions. '--no-binary', ':all:'] logging.info('Executing command: %s', cmd_args) - result = processes.call(cmd_args) - if result != 0: - raise RuntimeError( - 'Failed to execute command: %s. Exit code %d', - cmd_args, result) + processes.check_call(cmd_args) def stage_job_resources( @@ -381,11 +374,7 @@ def _build_setup_package(setup_file, temp_dir, build_setup_args=None): 'python', os.path.basename(setup_file), 'sdist', '--dist-dir', temp_dir] logging.info('Executing command: %s', build_setup_args) - result = processes.call(build_setup_args) - if result != 0: - raise RuntimeError( - 'Failed to execute command: %s. Exit code %d', - build_setup_args, result) + processes.check_call(build_setup_args) output_files = glob.glob(os.path.join(temp_dir, '*.tar.gz')) if not output_files: raise RuntimeError( @@ -438,8 +427,8 @@ def get_required_container_version(): import pkg_resources as pkg try: version = pkg.get_distribution(GOOGLE_PACKAGE_NAME).version - # We drop any pre/post parts of the version and we keep only the X.Y.Z format. - # For instance the 0.3.0rc2 SDK version translates into 0.3.0. + # We drop any pre/post parts of the version and we keep only the X.Y.Z + # format. For instance the 0.3.0rc2 SDK version translates into 0.3.0. return '%s.%s.%s' % pkg.parse_version(version)._version.release except pkg.DistributionNotFound: # This case covers Apache Beam end-to-end testing scenarios. All these tests @@ -458,11 +447,7 @@ def _download_pypi_sdk_package(temp_dir): '%s==%s' % (GOOGLE_PACKAGE_NAME, version), '--no-binary', ':all:', '--no-deps'] logging.info('Executing command: %s', cmd_args) - result = processes.call(cmd_args) - if result != 0: - raise RuntimeError( - 'Failed to execute command: %s. Exit code %d', - cmd_args, result) + processes.check_call(cmd_args) zip_expected = os.path.join( temp_dir, '%s-%s.zip' % (GOOGLE_PACKAGE_NAME, version)) if os.path.exists(zip_expected):