ansible-inventory-puppetdb icon indicating copy to clipboard operation
ansible-inventory-puppetdb copied to clipboard

TypeError: connect() got an unexpected keyword argument 'api_version'

Open domingusj opened this issue 9 years ago • 7 comments

Thanks for your work on this and I'm hoping I can get it working. I updated puppetdb.yml with my info:

host: 10.2.0.10
api_version: 3
port: 8081
timeout: 10
ssl_verify: False
ssl_key:
ssl_cert:
cache_file: '/tmp/ansible-inventory-puppetdb.cache'
cache_duration: 30
group_by:
group_by_tag:

but when I run ./puppetdb.py --list I get:

Traceback (most recent call last): File "./puppetdb.py", line 234, in <module> main() File "./puppetdb.py", line 226, in main inventory = PuppetdbInventory(args.refresh) File "./puppetdb.py", line 86, in __init__ self.puppetdb = connect(**puppetdb_config) TypeError: connect() got an unexpected keyword argument 'api_version'

Any ideas?

domingusj avatar Jan 29 '16 03:01 domingusj

Your running the newer version of pypuppetdb

Make sure you install the 0.1.1 branch not master and this will resolve itself.

Techcadia avatar Feb 17 '16 22:02 Techcadia

Gotcha, I will give that a try, thank you for the response!

domingusj avatar Feb 17 '16 22:02 domingusj

Hi @Techcadia ,I think version 0.1.1 doesn't support puppetdb 4.0., any chance to update script for using pypuppetdb 0.2.2 and puppetdb api version 4?

xtavras avatar May 13 '16 10:05 xtavras

I think this was fixed by https://github.com/dmsimard/ansible-inventory-puppetdb/pull/5 - it's been merged.

dmsimard avatar May 21 '16 17:05 dmsimard

I may be mistaken, but doesn't #5 make this incompatible with the 0.1.x version of pypuppetdb (which needs the api_version)? I don't have an older version setup to test with, but I can do a pr, which should allow both versions of pypuppetdb to work.

sedunne avatar Jun 10 '16 05:06 sedunne

A backwards compatible change would be welcome.

dmsimard avatar Jun 10 '16 12:06 dmsimard

PR #6 should allow both versions of pypuppetdb to work. I've used it with Puppet DB 4, but unfortunately don't have access to an older install to test that with.

sedunne avatar Jun 10 '16 15:06 sedunne