File tree 5 files changed +13
-3
lines changed
5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,8 @@ connect. Therefor you'll also have to supply the following settings:
190
190
* ``PUPPETDB_CERT = /path/to/public/keyfile.crt ``
191
191
192
192
For information about how to generate the correct keys please refer to the
193
- `pypuppetdb documentation `_.
193
+ `pypuppetdb documentation `_. Alternatively is possible to explicitly specify
194
+ the protocol to be used setting the ``PUPPETDB_PROTO `` variable.
194
195
195
196
Other settings that might be interesting in no particular order:
196
197
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ def get_puppetdb():
47
47
ssl_verify = app .config ['PUPPETDB_SSL_VERIFY' ],
48
48
ssl_key = app .config ['PUPPETDB_KEY' ],
49
49
ssl_cert = app .config ['PUPPETDB_CERT' ],
50
- timeout = app .config ['PUPPETDB_TIMEOUT' ],)
50
+ timeout = app .config ['PUPPETDB_TIMEOUT' ],
51
+ protocol = app .config ['PUPPETDB_PROTO' ],)
51
52
PUPPETDB = puppetdb
52
53
53
54
return PUPPETDB
Original file line number Diff line number Diff line change 2
2
3
3
PUPPETDB_HOST = 'localhost'
4
4
PUPPETDB_PORT = 8080
5
+ PUPPETDB_PROTO = None
5
6
PUPPETDB_SSL_VERIFY = True
6
7
PUPPETDB_KEY = None
7
8
PUPPETDB_CERT = None
Original file line number Diff line number Diff line change 2
2
3
3
PUPPETDB_HOST = os .getenv ('PUPPETDB_HOST' , 'puppetdb' )
4
4
PUPPETDB_PORT = int (os .getenv ('PUPPETDB_PORT' , '8080' ))
5
- # Since this is an env it will alwas be a string, we need
5
+ # Since this is an env it will always be a string, we need
6
6
# to conver that string to a bool
7
7
SSL_VERIFY = os .getenv ('PUPPETDB_SSL_VERIFY' , 'True' )
8
8
if SSL_VERIFY .upper () == 'TRUE' :
14
14
15
15
PUPPETDB_KEY = os .getenv ('PUPPETDB_KEY' , None )
16
16
PUPPETDB_CERT = os .getenv ('PUPPETDB_CERT' , None )
17
+ PUPPETDB_PROTO = os .getenv ('PUPPETDB_PROTO' , None )
17
18
PUPPETDB_TIMEOUT = int (os .getenv ('PUPPETDB_TIMEOUT' , '20' ))
18
19
DEFAULT_ENVIRONMENT = os .getenv ('DEFAULT_ENVIRONMENT' , 'production' )
19
20
SECRET_KEY = os .getenv ('SECRET_KEY' , os .urandom (24 ))
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ def test_set_host_port(cleanUpEnv):
40
40
assert docker_settings .PUPPETDB_PORT == 9081
41
41
42
42
43
+ def test_set_proto (cleanUpEnv ):
44
+ os .environ ['PUPPETDB_PROTO' ] = 'https'
45
+ reload (docker_settings )
46
+ assert docker_settings .PUPPETDB_PROTO == 'https'
47
+
48
+
43
49
def test_cert_true_test (cleanUpEnv ):
44
50
os .environ ['PUPPETDB_SSL_VERIFY' ] = 'True'
45
51
reload (docker_settings )
You can’t perform that action at this time.
0 commit comments