File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ The Pure Storage FlashArray collection consists of the latest versions of the Fl
25
25
- pycountry
26
26
- packaging
27
27
- pyz
28
+ - urllib3
28
29
29
30
## Installation
30
31
Original file line number Diff line number Diff line change
1
+ minor_changes :
2
+ - all - add ``disable_warnings`` parameters
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ class ModuleDocFragment(object):
30
30
description:
31
31
- FlashArray API token for admin privileged user.
32
32
type: str
33
+ disable_warnings:
34
+ description:
35
+ - Disable insecure certificate warnings in debug logs
36
+ type: bool
37
+ default: false
38
+ version_added: '1.29.0'
33
39
notes:
34
40
- This module requires the C(purestorage) and C(py-pure-client) Python libraries
35
41
- Additional Python librarues may be required for specific modules.
@@ -42,4 +48,5 @@ class ModuleDocFragment(object):
42
48
- netaddr
43
49
- requests
44
50
- pycountry
51
+ - urllib3
45
52
"""
Original file line number Diff line number Diff line change 32
32
33
33
__metaclass__ = type
34
34
35
+ HAS_URLLIB3 = True
36
+ try :
37
+ import urllib3
38
+ except ImportError :
39
+ HAS_URLLIB3 = False
40
+
35
41
HAS_DISTRO = True
36
42
try :
37
43
import distro
59
65
60
66
def get_system (module ):
61
67
"""Return System Object or Fail"""
68
+ if HAS_URLLIB3 and module .params ["disable_warnings" ]:
69
+ urllib3 .disable_warnings ()
62
70
if HAS_DISTRO :
63
71
user_agent = "%(base)s %(class)s/%(version)s (%(platform)s)" % {
64
72
"base" : USER_AGENT_BASE ,
@@ -105,6 +113,8 @@ def get_system(module):
105
113
106
114
def get_array (module ):
107
115
"""Return System Object or Fail"""
116
+ if HAS_URLLIB3 and module .params ["disable_warnings" ]:
117
+ urllib3 .disable_warnings ()
108
118
if HAS_DISTRO :
109
119
user_agent = "%(base)s %(class)s/%(version)s (%(platform)s)" % {
110
120
"base" : USER_AGENT_BASE ,
@@ -156,4 +166,5 @@ def purefa_argument_spec():
156
166
return dict (
157
167
fa_url = dict (),
158
168
api_token = dict (no_log = True ),
169
+ disable_warnings = dict (type = "bool" , default = False ),
159
170
)
Original file line number Diff line number Diff line change 6
6
requests
7
7
pycountry
8
8
pytz
9
+ urllib3
You can’t perform that action at this time.
0 commit comments