mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Move plugin option settings. (#44774)
* Move plugin option settings. * Add default value and clear after use.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user