diff options
author | Dag Wieers <dag@wieers.com> | 2016-08-25 00:47:39 +0200 |
---|---|---|
committer | Brian Coca <bcoca@users.noreply.github.com> | 2016-08-24 18:47:39 -0400 |
commit | ec158e3ed83eaded352d59cb3c228704b5c03cfe (patch) | |
tree | 23123d6b4849187a38c2624c07363a0126c42840 | |
parent | 55191c77b887e8b341ba49773ba610623ca17012 (diff) | |
download | ansible-modules-core-ec158e3ed83eaded352d59cb3c228704b5c03cfe.tar.gz |
Remove redundant code AFAICT (#3908)
-rw-r--r-- | commands/command.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/commands/command.py b/commands/command.py index 3242aeb4..9892e7c5 100644 --- a/commands/command.py +++ b/commands/command.py @@ -102,38 +102,6 @@ import os from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import b -# Dict of options and their defaults -OPTIONS = {'chdir': None, - 'creates': None, - 'executable': None, - 'NO_LOG': None, - 'removes': None, - 'warn': True, - } - -# This is a pretty complex regex, which functions as follows: -# -# 1. (^|\s) -# ^ look for a space or the beginning of the line -# 2. ({options_list})= -# ^ expanded to (chdir|creates|executable...)= -# look for a valid param, followed by an '=' -# 3. (?P<quote>[\'"])? -# ^ look for an optional quote character, which can either be -# a single or double quote character, and store it for later -# 4. (.*?) -# ^ match everything in a non-greedy manner until... -# 5. (?(quote)(?<!\\)(?P=quote))((?<!\\)(?=\s)|$) -# ^ a non-escaped space or a non-escaped quote of the same kind -# that was matched in the first 'quote' is found, or the end of -# the line is reached -OPTIONS_REGEX = '|'.join(OPTIONS.keys()) -PARAM_REGEX = re.compile( - r'(^|\s)(' + OPTIONS_REGEX + - r')=(?P<quote>[\'"])?(.*?)(?(quote)(?<!\\)(?P=quote))((?<!\\)(?=\s)|$)' -) - - def check_command(commandline): arguments = { 'chown': 'owner', 'chmod': 'mode', 'chgrp': 'group', 'ln': 'state=link', 'mkdir': 'state=directory', |