Fix become for network_cli in collections.
This commit is contained in:
parent
854925b072
commit
65646179f1
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/network-cli-become-collections.yml
Normal file
2
changelogs/fragments/network-cli-become-collections.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Skipping of become for ``network_cli`` connections now works when ``network_cli`` is sourced from a collection.
|
|
@ -1048,7 +1048,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
ruser = self._get_remote_user()
|
ruser = self._get_remote_user()
|
||||||
buser = self.get_become_option('become_user')
|
buser = self.get_become_option('become_user')
|
||||||
if (sudoable and self._connection.become and # if sudoable and have become
|
if (sudoable and self._connection.become and # if sudoable and have become
|
||||||
self._connection.transport != 'network_cli' and # if not using network_cli
|
self._connection.transport.split('.')[-1] != 'network_cli' and # if not using network_cli
|
||||||
(C.BECOME_ALLOW_SAME_USER or (buser != ruser or not any((ruser, buser))))): # if we allow same user PE or users are different and either is set
|
(C.BECOME_ALLOW_SAME_USER or (buser != ruser or not any((ruser, buser))))): # if we allow same user PE or users are different and either is set
|
||||||
display.debug("_low_level_execute_command(): using become for this command")
|
display.debug("_low_level_execute_command(): using become for this command")
|
||||||
cmd = self._connection.become.build_become_command(cmd, self._connection._shell)
|
cmd = self._connection.become.build_become_command(cmd, self._connection._shell)
|
||||||
|
|
Loading…
Reference in a new issue