mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Move plugin option settings. (#44774)
* Move plugin option settings. * Add default value and clear after use.
This commit is contained in:
parent
0c3216c565
commit
86f96d0212
5 changed files with 17 additions and 15 deletions
|
@ -206,10 +206,8 @@ class Connection(NetworkConnectionBase):
|
|||
|
||||
httpapi = httpapi_loader.get(self._network_os, self)
|
||||
if httpapi:
|
||||
display.vvvv('loaded API plugin for network_os %s' % self._network_os, host=self._play_context.remote_addr)
|
||||
display.vvvv('loaded API plugin for network_os %s' % self._network_os, host=host)
|
||||
self._implementation_plugins.append(httpapi)
|
||||
httpapi.set_become(self._play_context)
|
||||
httpapi.login(self.get_option('remote_user'), self.get_option('password'))
|
||||
else:
|
||||
raise AnsibleConnectionFailure('unable to load API plugin for network_os %s' % self._network_os)
|
||||
|
||||
|
@ -220,6 +218,11 @@ class Connection(NetworkConnectionBase):
|
|||
else:
|
||||
display.vvvv('unable to load cliconf for network_os %s' % self._network_os)
|
||||
|
||||
super(Connection, self)._connect()
|
||||
|
||||
httpapi.set_become(self._play_context)
|
||||
httpapi.login(self.get_option('remote_user'), self.get_option('password'))
|
||||
|
||||
self._connected = True
|
||||
|
||||
def close(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue