[
https://issues.apache.org/jira/browse/LIBCLOUD-817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15264650#comment-15264650
]
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 and
documentation, please see http://libcloud.apache.org
INSTALLED: 0.20.1
ansible --version
ansible 2.1.0
config file =
configured module search path = 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 and
documentation, please see http://libcloud.apache.org
INSTALLED: 0.20.1
# ansible --version
ansible 2.1.0
config file =
configured module search path = 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! => {"changed": false, "failed": true, "msg":
> "Unexpected response: (unsupported type for timedelta seconds component:
> NoneType). Detail: Traceback (most recent call last):\n File
> \"/usr/lib/python2.7/site-packages/ansible-2.1.0-py2.7.egg/ansible/module_utils/gce.py\",
> line 85, in gce_connect\n project=project_id)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py\", line
> 1058, in __init__\n self.zone_list = self.ex_list_zones()\n File
> \"/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py\", line
> 1790, in ex_list_zones\n response = self.connection.request(request,
> method='GET').object\n File
> \"/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py\", line
> 120, in request\n response = super(GCEConnection, self).request(*args,
> **kwargs)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/google.py\", line 718, in
> request\n *args, **kwargs)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/base.py\", line 748, in
> request\n params, headers = 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-packages/libcloud/common/google.py\", line 697, in
> pre_connect_hook\n self._refresh_oauth2_token()\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/google.py\", line 772, in
> _refresh_oauth2_token\n self.oauth2_token =
> self.oauth2_conn.refresh_token(self.oauth2_token)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/google.py\", line 382, in
> refresh_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 return self._token_request(request)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/google.py\", line 358, in
> _token_request\n data=data)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/common/base.py\", line 779, in
> request\n headers=headers)\n File
> \"/usr/lib/python2.7/site-packages/libcloud/utils/misc.py\", line 320, in
> retry_loop\n end = datetime.now() + timedelta(seconds=timeout)\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 = datetime.now() + timedelta(seconds=timeout)
> to
> end = datetime.now() + timedelta(seconds=10)
> And run playbook again. And i can create new instanse from ansible. Can you
> explain this error, please?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)