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 2D2FA19E6C for ; Fri, 29 Apr 2016 20:08:13 +0000 (UTC) Received: (qmail 46377 invoked by uid 500); 29 Apr 2016 20:08:13 -0000 Delivered-To: apmail-libcloud-notifications-archive@libcloud.apache.org Received: (qmail 46343 invoked by uid 500); 29 Apr 2016 20:08: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 46330 invoked by uid 99); 29 Apr 2016 20:08:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Apr 2016 20:08:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id ECA3B2C1F60 for ; Fri, 29 Apr 2016 20:08:12 +0000 (UTC) Date: Fri, 29 Apr 2016 20:08:12 +0000 (UTC) From: "Andrey Sidorov (JIRA)" To: notifications@libcloud.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (LIBCLOUD-817) TypeError: unsupported type for timedelta seconds component: NoneType MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LIBCLOUD-817?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D15= 264650#comment-15264650 ]=20 Andrey Sidorov edited comment on LIBCLOUD-817 at 4/29/16 8:08 PM: ------------------------------------------------------------------ Sorry, forget: apache-libcloud - A standard Python library that abstracts = away differences among multiple cloud provider APIs. For more information a= nd documentation, please see http://libcloud.apache.org INSTALLED: 0.20.1 ansible --version ansible 2.1.0 config file =3D=20 configured module search path =3D Default w/o overrides was (Author: wimbo): Sorry, forget: apache-libcloud - A standard Python library that abstracts = away differences among multiple cloud provider APIs. For more information a= nd documentation, please see http://libcloud.apache.org INSTALLED: 0.20.1 # ansible --version ansible 2.1.0 config file =3D=20 configured module search path =3D Default w/o overrides > TypeError: unsupported type for timedelta seconds component: NoneType > --------------------------------------------------------------------- > > Key: LIBCLOUD-817 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-817 > Project: Libcloud > Issue Type: Bug > Components: Compute > Reporter: Andrey Sidorov > Assignee: Eric Johnson > Priority: Blocker > > Hi all. > When i run ansible playbook for create instance on Google Compute Engine: > - name: Create instance > hosts: localhost > connection: local > gather_facts: no > vars: > service_account_email: email > pem_file: pem_file > project_id: project > machine_type: f1-micro > image: image > zone: europe-west1-d > network: dev > tasks: > - name: launch instance > gce: > instance_names: test > machine_type: "{{ machine_type }}" > image: "{{ image }}" > service_account_email: "{{ service_account_email }}" > pem_file: "{{ pem_file }}" > project_id: "{{ project_id }}" > zone: "{{ zone }}" > network: "{{ network }}" > preemptible: true > I got error: > fatal: [localhost]: FAILED! =3D> {"changed": false, "failed": true, "msg"= : "Unexpected response: (unsupported type for timedelta seconds component: = NoneType). Detail: Traceback (most recent call last):\n File \"/usr/lib/py= thon2.7/site-packages/ansible-2.1.0-py2.7.egg/ansible/module_utils/gce.py\"= , line 85, in gce_connect\n project=3Dproject_id)\n File \"/usr/lib/pyt= hon2.7/site-packages/libcloud/compute/drivers/gce.py\", line 1058, in __ini= t__\n self.zone_list =3D self.ex_list_zones()\n File \"/usr/lib/python2= .7/site-packages/libcloud/compute/drivers/gce.py\", line 1790, in ex_list_z= ones\n response =3D self.connection.request(request, method=3D'GET').obj= ect\n File \"/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce= .py\", line 120, in request\n response =3D super(GCEConnection, self).re= quest(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/libcloud/= common/google.py\", line 718, in request\n *args, **kwargs)\n File \"/u= sr/lib/python2.7/site-packages/libcloud/common/base.py\", line 748, in requ= est\n params, headers =3D self.pre_connect_hook(params, headers)\n File= \"/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py\", line= 109, in pre_connect_hook\n headers)\n File \"/usr/lib/python2.7/site-p= ackages/libcloud/common/google.py\", line 697, in pre_connect_hook\n sel= f._refresh_oauth2_token()\n File \"/usr/lib/python2.7/site-packages/libclo= ud/common/google.py\", line 772, in _refresh_oauth2_token\n self.oauth2_= token =3D self.oauth2_conn.refresh_token(self.oauth2_token)\n File \"/usr/= lib/python2.7/site-packages/libcloud/common/google.py\", line 382, in refre= sh_token\n return self.get_new_token()\n File \"/usr/lib/python2.7/site= -packages/libcloud/common/google.py\", line 530, in get_new_token\n retu= rn self._token_request(request)\n File \"/usr/lib/python2.7/site-packages/= libcloud/common/google.py\", line 358, in _token_request\n data=3Ddata)\= n File \"/usr/lib/python2.7/site-packages/libcloud/common/base.py\", line = 779, in request\n headers=3Dheaders)\n File \"/usr/lib/python2.7/site-p= ackages/libcloud/utils/misc.py\", line 320, in retry_loop\n end =3D date= time.now() + timedelta(seconds=3Dtimeout)\nTypeError: unsupported type for = timedelta seconds component: NoneType\n"} > And i modify /usr/lib/python2.7/site-packages/libcloud/utils/misc.py and = change: > end =3D datetime.now() + timedelta(seconds=3Dtimeout) > to=20 > end =3D datetime.now() + timedelta(seconds=3D10) > And run playbook again. And i can create new instanse from ansible. Can y= ou explain this error, please? -- This message was sent by Atlassian JIRA (v6.3.4#6332)