Reputation: 160
I'm using:
Python code looks like this:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
def run():
""" Run this script
"""
ComputeEngine = get_driver(Provider.GCE)
driver = ComputeEngine(user_id='****@****.com',
credential_file='serviceaccount.json',
project='****')
run()
When I run my code, I'm getting:
Traceback (most recent call last):
File "./myscript.py", line 47, in <module>
run()
File "./myscript.py", line 21, in run
project='ebs-it', secure=True)
File "/***/virtualenv/lib/python3.5/site-packages/libcloud/compute/drivers/gce.py", line 1795, in __init__
super(GCENodeDriver, self).__init__(user_id, key, **kwargs)
File "/***/virtualenv/lib/python3.5/site-packages/libcloud/common/base.py", line 975, in __init__
self.connection = self.connectionCls(*args, **conn_kwargs)
TypeError: __init__() missing 1 required positional argument: 'secure'
This looks perfectly textbook to me. Any idea what could be going wrong?
Upvotes: 0
Views: 147
Reputation: 160
The issue was two fold: unfamiliarity with Google's service accounts, which led to an error in coding.
credential_file
parameter, which seemed to fit better than the key
parameter that should be used for the service account file. That is what led to the actual error I was seeing.Upvotes: 0