summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2020-04-16 13:01:20 +1000
committerGitHub <noreply@github.com>2020-04-16 13:01:20 +1000
commitcce6153cd17c0e61806c89317d52af58f6217af7 (patch)
treeaf430cba16c50b3ce0a1d2af182ebbf06e986811
parent46d82179d8fb32ec51ac0ba03ce4445d17c13d34 (diff)
downloadansible-cce6153cd17c0e61806c89317d52af58f6217af7.tar.gz
Remove unused functions (#68969)
-rw-r--r--lib/ansible/plugins/shell/powershell.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py
index d387bdab2f..f504b16dd9 100644
--- a/lib/ansible/plugins/shell/powershell.py
+++ b/lib/ansible/plugins/shell/powershell.py
@@ -24,7 +24,6 @@ import pkgutil
import xml.etree.ElementTree as ET
import ntpath
-from ansible.errors import AnsibleError
from ansible.module_utils._text import to_bytes, to_text
from ansible.plugins.shell import ShellBase
@@ -68,27 +67,8 @@ class ShellModule(ShellBase):
# Used by various parts of Ansible to do Windows specific changes
_IS_WINDOWS = True
- env = dict()
-
- # We're being overly cautious about which keys to accept (more so than
- # the Windows environment is capable of doing), since the powershell
- # env provider's limitations don't appear to be documented.
- safe_envkey = re.compile(r'^[\d\w_]{1,255}$')
-
# TODO: add binary module support
- def assert_safe_env_key(self, key):
- if not self.safe_envkey.match(key):
- raise AnsibleError("Invalid PowerShell environment key: %s" % key)
- return key
-
- def safe_env_value(self, key, value):
- if len(value) > 32767:
- raise AnsibleError("PowerShell environment value for key '%s' exceeds 32767 characters in length" % key)
- # powershell single quoted literals need single-quote doubling as their only escaping
- value = value.replace("'", "''")
- return to_text(value, errors='surrogate_or_strict')
-
def env_prefix(self, **kwargs):
# powershell/winrm env handling is handled in the exec wrapper
return ""