Return-Path: X-Original-To: apmail-libcloud-notifications-archive@www.apache.org Delivered-To: apmail-libcloud-notifications-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 220D510CD6 for ; Wed, 31 Dec 2014 23:34:13 +0000 (UTC) Received: (qmail 87501 invoked by uid 500); 31 Dec 2014 23:34:13 -0000 Delivered-To: apmail-libcloud-notifications-archive@libcloud.apache.org Received: (qmail 87473 invoked by uid 500); 31 Dec 2014 23:34:13 -0000 Mailing-List: contact notifications-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list notifications@libcloud.apache.org Received: (qmail 87463 invoked by uid 99); 31 Dec 2014 23:34:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Dec 2014 23:34:13 +0000 Date: Wed, 31 Dec 2014 23:34:13 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: notifications@libcloud.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LIBCLOUD-610) GCE Driver with bad private key path generates unintuitive error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LIBCLOUD-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14262493#comment-14262493 ] ASF subversion and git services commented on LIBCLOUD-610: ---------------------------------------------------------- Commit 5f0ccc1a5c3efb1a76e9e414e9691a17ba7f40a9 in libcloud's branch refs/heads/trunk from [~erjohnso] [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=5f0ccc1 ] Revert "[LIBCLOUD-610] gce: better error message for missing key file" This reverts commit 95ae5beea125797ba3bd07028af1dbbd65dc2265. Signed-off-by: Eric Johnson > GCE Driver with bad private key path generates unintuitive error message > ------------------------------------------------------------------------ > > Key: LIBCLOUD-610 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-610 > Project: Libcloud > Issue Type: Bug > Components: Compute > Reporter: Jeff Tratner > Assignee: Eric Johnson > Priority: Minor > Labels: Google > > When you pass a key to the GCE driver and the path doesn't exist, it ends up passing the buck down to PyCrypto, because it assumes that it isn't a keypath. Relevant lines are here (snipped from `__init__` method of `GoogleBaseAuthConnection`): > {code:title=gce.py} > keypath = os.path.expanduser(key) > is_file_path = os.path.exists(keypath) and os.path.isfile(keypath) > if is_file_path: > with open(keypath, 'r') as f: > key = f.read() > super(GoogleServiceAcctAuthConnection, self).__init__( > user_id, key, *args, **kwargs) > {code} > The problem is the keypath doesn't exist (and obviously it's not a file), so instead of a nice error message saying 'invalid file path', you get a ValueError from PyCrypto saying 'ValueError: RSA key format is not supported' which is problematic especially because you also get this error if you have the wrong version of PyCrypto installed. Given that PyCrypto actually expects bytes, I think it makes sense for libcloud to be responsible for this error. > I encountered this using salt and there's an open issue to deal with it on the salt end here - https://github.com/saltstack/salt/pull/15589 -- This message was sent by Atlassian JIRA (v6.3.4#6332)