Skip to content

Commit

Permalink
Change except Error when trying to get a missing option
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored and bcoca committed Apr 27, 2018
1 parent efe7c20 commit 25dea1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/plugins/action/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ def _make_tmp_path(self, remote_user=None):

try:
admin_users = self._connection._shell.get_option('admin_users') + [remote_user]
except KeyError:
except AnsibleError:
admin_users = ['root', remote_user] # plugin does not support admin_users
try:
remote_tmp = self._connection._shell.get_option('remote_tmp')
except KeyError:
except AnsibleError:
remote_tmp = '~/ansible'

# deal with tmpdir creation
Expand Down Expand Up @@ -405,7 +405,7 @@ def _fixup_perms2(self, remote_paths, remote_user=None, execute=True):

try:
admin_users = self._connection._shell.get_option('admin_users')
except KeyError:
except AnsibleError:
admin_users = ['root'] # plugin does not support admin users

if self._play_context.become and self._play_context.become_user and self._play_context.become_user not in admin_users + [remote_user]:
Expand Down
6 changes: 0 additions & 6 deletions lib/ansible/plugins/shell/powershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
key: remote_tmp
vars:
- name: ansible_remote_tmp
admin_users:
description:
- List of users to be expected to have admin privileges, this is unused
in the PowerShell plugin
type: list
default: []
set_module_language:
description:
- Controls if we set the locale for moduels when executing on the
Expand Down

0 comments on commit 25dea1f

Please sign in to comment.