swift keystoneclient error “got an unexpected keyword argument 'insecure'”

asked 2013-06-03 07:34:38 -0500

juck78 gravatar image

A week ago, i used a computer with swift and keystone well. today i want to set the same definition on another virtual machine.I got "TypeError: __init__() got an unexpected keyword argument 'insecure'", this time i got the new code from http://github.com .

$ swift -V 2.0 -A -U adminTenant:admin -K openstack stat Traceback (most recent call last): File "/usr/local/bin/swift", line 5, in pkg_resources.run_script('python-swiftclient==1.4.0', 'swift') File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/EGG-INFO/scripts/swift", line 1331, in error_queue) File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/EGG-INFO/scripts/swift", line 584, in st_stat headers = conn.head_account() File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 1053, in head_account return self._retry(None, head_account) File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 1022, in _retry self.url, self.token = self.get_auth() File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 1010, in get_auth insecure=self.insecure) File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 329, in get_auth insecure=insecure) File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 261, in get_keystoneclient_2_0 auth_url=auth_url, insecure=insecure) File "/usr/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py", line 66, in __init__ super(Client, self).__init__(endpoint=endpoint, **kwargs) TypeError: __init__() got an unexpected keyword argument 'insecure'

my proxy-server.conf like this:

[DEFAULT] bind_ip = bind_port = 80 swift_dir = /etc/swift workers = 1 user = swift #cert_file = /etc/swift/cert.crt #key_file = /etc/swift/cert.key #log_name = swift #log_facility = LOG_LOCAL0 #log_level = DEBUG

[pipeline:main] pipeline = catch_errors healthcheck cache ratelimit authtoken keystone proxy-server #pipeline = catch_errors healthcheck cache ratelimit tempauth proxy-server

[app:proxy-server] use = egg:swift#proxy account_autocreate = true log_level = DEBUG

[filter:authtoken] paste.filter_factory = keystone.middleware.auth_token:filter_factory #the host must point to your keystone server auth_host = auth_port = 35357 auth_protocol=http service_host = service_port = 5000 admin_token = ADMIN admin_user = admin admin_password = openstack admin_tenant_name = demo

[filter:keystone] paste.filter_factory = keystone.middleware.swift_auth:filter_factory #use=egg:swift operator_roles = adminRole, swiftoperator #is_admin = true #reseller_prefix=AUTH

[filter:tempauth] use = egg:swift#tempauth user_admin_admin = admin .admin .reseller_admin user_test_tester = testing .admin user_test2_tester2 = testing2 .admin user_test_tester3 = testing3 [filter:healthcheck] use = egg:swift#healthcheck

[filter:cache] use = egg:swift#memcache memcache_servers =

[filter:ratelimit] use = egg:swift#ratelimit

[filter:domain_remap] use = egg:swift#domain_remap

[filter:catch_errors] use = egg:swift#catch_errors

i use curl to test the keystone service. it works well!

curl -X POST -d '{"auth": {"tenantName": "demo", "passwordCredentials":{"username": "admin ... (more)

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2013-06-03 13:01:51 -0500

juck78 gravatar image

i have solved this problem,but i don't know why, i readed the log File "/usr/local/lib/python2.7/dist-packages/python_swiftclient-1.4.0-py2.7.egg/swiftclient/client.py", line 261, in get_keystoneclient_2_0 auth_url=auth_url, insecure=insecure) i know something worng with the client.py so i look for it, _ksclient = ksclient.Client(username=user, password=key, tenant_name=os_options.get('tenant_name'), tenant_id=os_options.get('tenant_id'), debug=debug, cacert=kwargs.get('cacert'), auth_url=auth_url,insecure=insecure) changed it to _ksclient = ksclient.Client(username=user, password=key, tenant_name=os_options.get('tenant_name'), tenant_id=os_options.get('tenant_id'), #debug=debug, #cacert=kwargs.get('cacert'), #auth_url=auth_url,insecure=insecure) auth_url=auth_url) it worked!,but i don't know why,anyone can help me ?

edit flag offensive delete link more

answered 2013-06-04 17:33:41 -0500

The problems is in python-keystoneclient where is that Client ant its parent class define.

Your keystoneclient is not newest. Update your codes if you could use master branch

I have a simple scan of keystoneclient and find that in an old version the Client.__init__ doesn't use insecure keyword. So have a try to updating your keystoneclient.

edit flag offensive delete link more

answered 2013-06-05 09:28:17 -0500

juck78 gravatar image

Thanks Kun Huang, that solved my question.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-06-03 07:34:38 -0500

Seen: 324 times

Last updated: Jun 05 '13