145
145
platform_type:
146
146
description:
147
147
- Set type of platform.
148
+ ini:
149
+ - section: persistent_connetion
150
+ key: platform_type
148
151
env:
149
152
- name: ANSIBLE_PLATFORM_TYPE
150
153
vars:
@@ -177,40 +180,40 @@ def __init__(self, play_context, new_stdin, *args, **kwargs):
177
180
178
181
self ._auth = None
179
182
if self ._network_os :
180
- self .load_platform_plugins (self ._network_os )
183
+ self .load_platform_plugins (self ._network_os )
181
184
182
185
def load_platform_plugins (self , platform_type = None ):
183
- platform_type = platform_type or self .get_option ("platform_type" )
186
+ platform_type = platform_type or self .get_option ("platform_type" )
184
187
185
- if platform_type :
186
- self .httpapi = httpapi_loader .get (platform_type , self )
187
- if self .httpapi :
188
- self ._sub_plugin = {
189
- "type" : "httpapi" ,
190
- "name" : self .httpapi ._load_name ,
191
- "obj" : self .httpapi ,
192
- }
193
- self .queue_message (
194
- "vvvv" ,
195
- "loaded API plugin %s from path %s for platform type %s"
196
- % (
197
- self .httpapi ._load_name ,
198
- self .httpapi ._original_path ,
199
- platform_type ,
200
- ),
201
- )
202
- else :
203
- raise AnsibleConnectionFailure (
204
- "unable to load API plugin for platform type %s"
205
- % platform_type
206
- )
188
+ if platform_type :
189
+ self .httpapi = httpapi_loader .get (platform_type , self )
190
+ if self .httpapi :
191
+ self ._sub_plugin = {
192
+ "type" : "httpapi" ,
193
+ "name" : self .httpapi ._load_name ,
194
+ "obj" : self .httpapi ,
195
+ }
196
+ self .queue_message (
197
+ "vvvv" ,
198
+ "loaded API plugin %s from path %s for platform type %s"
199
+ % (
200
+ self .httpapi ._load_name ,
201
+ self .httpapi ._original_path ,
202
+ platform_type ,
203
+ ),
204
+ )
205
+ else :
206
+ raise AnsibleConnectionFailure (
207
+ "unable to load API plugin for platform type %s"
208
+ % platform_type
209
+ )
207
210
208
- else :
209
- raise AnsibleConnectionFailure (
210
- "Unable to automatically determine host platform type. Please "
211
- "manually configure platform_type value for this host"
212
- )
213
- self .queue_message ("log" , "platform_type is set to %s" % platform_type )
211
+ else :
212
+ raise AnsibleConnectionFailure (
213
+ "Unable to automatically determine host platform type. Please "
214
+ "manually configure platform_type value for this host"
215
+ )
216
+ self .queue_message ("log" , "platform_type is set to %s" % platform_type )
214
217
215
218
@property
216
219
def _url (self ):
@@ -331,4 +334,4 @@ def transport_test(self, connect_timeout):
331
334
request the root URL with no error handling.
332
335
"""
333
336
334
- open_url (self ._url , timeout = connect_timeout )
337
+ open_url (self ._url , timeout = connect_timeout )
0 commit comments