From 4f43293f0d9fad61be4e184da72ad913cc63433a Mon Sep 17 00:00:00 2001 From: Stephen Dunne III Date: Thu, 12 May 2016 12:12:29 -0400 Subject: [PATCH] update files for api v4 support --- puppetdb.py | 3 +++ puppetdb.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/puppetdb.py b/puppetdb.py index 1453b23..bdcfa8b 100755 --- a/puppetdb.py +++ b/puppetdb.py @@ -83,6 +83,9 @@ def __init__(self, refresh): 'ssl_cert': self.config.get('ssl_cert') or None } + if puppetdb_config['api_version'] == 4: + del puppetdb_config['api_version'] + self.puppetdb = connect(**puppetdb_config) self.cache_file = self.config.get('cache_file') diff --git a/puppetdb.yml b/puppetdb.yml index 5f19b64..77f2c11 100644 --- a/puppetdb.yml +++ b/puppetdb.yml @@ -49,6 +49,10 @@ # Regardless of whether or not group_by is set, the inventory will # always return a group called 'all' with all the hosts in it. # +# == Notes on api_version +# When set to 4, this will allow the use of pypuppetdb 2.x, which deprecated +# the api versions. If set to 4 with pypuppetdb 0.1.1 installed it will +# produce an invalid version error. --- host: localhost api_version: 3