From 7bd8b1360fdf234d33da4e1fe30d2a7ad91c5861 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 29 May 2014 01:32:54 +0100 Subject: [PATCH] Remove remaining `exsel` code --- doc/ref/cli/_includes/extended-target-selection.rst | 5 ----- pkg/salt.bash | 8 ++------ salt/minion.py | 8 -------- salt/utils/minions.py | 2 -- salt/utils/parsers.py | 7 ------- scripts/completion/zsh_completion.zsh | 1 - .../files/file/base/issue-2167-exsel-match.sls | 4 ---- tests/integration/states/match.py | 8 -------- 8 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 tests/integration/files/file/base/issue-2167-exsel-match.sls diff --git a/doc/ref/cli/_includes/extended-target-selection.rst b/doc/ref/cli/_includes/extended-target-selection.rst index a04e208a163..e076e673008 100644 --- a/doc/ref/cli/_includes/extended-target-selection.rst +++ b/doc/ref/cli/_includes/extended-target-selection.rst @@ -6,11 +6,6 @@ letter denoting the type; example: 'webserv* and G@os:Debian or E@db*' Make sure that the compound target is encapsulated in quotes. -.. option:: -X, --exsel - - Instead of using shell globs, use the return code of a function. - - .. option:: -I, --pillar Instead of using shell globs to evaluate the target, use a pillar value to diff --git a/pkg/salt.bash b/pkg/salt.bash index 8d7ff7fda81..521b5cf7ca1 100644 --- a/pkg/salt.bash +++ b/pkg/salt.bash @@ -5,7 +5,6 @@ # TODO: solve somehow completion for salt -G pythonversion:[tab] # (not sure what to do with lists) # TODO: --range[tab] -- how? -# TODO: -E --exsel[tab] -- how? # TODO: --compound[tab] -- how? # TODO: use history to extract some words, esp. if ${cur} is empty # TODO: TEST EVERYTHING a lot @@ -45,7 +44,7 @@ _salt(){ opts="-h --help -d --doc --documentation --version --versions-report -c \ --config-dir= -v --verbose -t --timeout= -s --static -b --batch= \ --batch-size= -E --pcre -L --list -G --grain --grain-pcre -N \ - --nodegroup -R --range -C --compound -X --exsel -I --pillar \ + --nodegroup -R --range -C --compound -I --pillar \ --return= -a --auth= --eauth= --extended-auth= -T --make-token -S \ --ipcidr --out=pprint --out=yaml --out=overstatestage --out=json \ --out=raw --out=highstate --out=key --out=txt --no-color --out-indent= " @@ -110,9 +109,6 @@ _salt(){ COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200")) return 0 ;; - -X|--exsel) # TODO: finish this one? how? - return 0 - ;; -N|--nodegroup) MASTER_CONFIG='/etc/salt/master' COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur})) @@ -267,7 +263,7 @@ _saltcp(){ opts="-t --timeout= -s --static -b --batch= --batch-size= \ -h --help --version --versions-report -c --config-dir= \ -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ - -R --range -C --compound -X --exsel -I --pillar \ + -R --range -C --compound -I --pillar \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=highstate --out=key --out=txt --no-color --out-indent= " if [[ "${cur}" == -* ]] ; then diff --git a/salt/minion.py b/salt/minion.py index 7f3b1ba3445..941a2f4b002 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1858,14 +1858,6 @@ class Matcher(object): comps[1], )) - def exsel_match(self, tgt): - ''' - Runs a function and return the exit code - ''' - if tgt not in self.functions: - return False - return self.functions[tgt]() - def pillar_match(self, tgt, delim=':'): ''' Reads in the pillar glob match diff --git a/salt/utils/minions.py b/salt/utils/minions.py index 26a7234c00c..a5293f0eb67 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -468,7 +468,6 @@ class CkMinions(object): ''' ref = {'G': 'grain', 'P': 'grain_pcre', - 'X': 'exsel', 'I': 'pillar', 'L': 'list', 'S': 'ipcidr', @@ -477,7 +476,6 @@ class CkMinions(object): infinite = [ 'node', 'ipcidr', - 'exsel', 'pillar'] if not self.opts.get('minion_data_cache', False): infinite.append('grain') diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 14fa8ef2c77..9f5e0897fd0 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -888,13 +888,6 @@ class ExtendedTargetOptionsMixIn(TargetOptionsMixIn): 'matching the specific targets argument type: salt ' '\'G@os:RedHat and webser* or E@database.*\'') ) - group.add_option( - '-X', '--exsel', - default=False, - action='store_true', - help=('Instead of using shell globs use the return code of ' - 'a function.') - ) group.add_option( '-I', '--pillar', default=False, diff --git a/scripts/completion/zsh_completion.zsh b/scripts/completion/zsh_completion.zsh index 9588e717205..f230cc68d7e 100644 --- a/scripts/completion/zsh_completion.zsh +++ b/scripts/completion/zsh_completion.zsh @@ -31,7 +31,6 @@ _target_options=( '(-N --nodegroup)'{-N,--nodegroup}'[use one of the predefined nodegroups to identify a list of targets.]:Nodegroup:' '(-R --range)'{-R,--range}'[use a range expression to identify targets.]:Range:' '(-C --compound)'{-C,--compound}'[Use multiple targeting options.]:Compound:' - '(-X --exsel)'{-X,--exsel}'[Use the return code of a function.]' '(-I --pillar)'{-I,--pillar}'[use a pillar value to identify targets.]:Pillar:' '(-S --ipcidr)'{-S,--ipcidr}'[Match based on Subnet (CIDR notation) or IPv4 address.]:Cidr:' ) diff --git a/tests/integration/files/file/base/issue-2167-exsel-match.sls b/tests/integration/files/file/base/issue-2167-exsel-match.sls deleted file mode 100644 index 618470295fb..00000000000 --- a/tests/integration/files/file/base/issue-2167-exsel-match.sls +++ /dev/null @@ -1,4 +0,0 @@ -base: - test.ping: - - match: exsel - - test diff --git a/tests/integration/states/match.py b/tests/integration/states/match.py index ddd4e570f02..e60aedbe898 100644 --- a/tests/integration/states/match.py +++ b/tests/integration/states/match.py @@ -27,14 +27,6 @@ class StateMatchTest(integration.ModuleCase): Validate the file state ''' - def test_issue_2167_exsel_no_AttributeError(self): - ret = self.run_function('state.top', ['issue-2167-exsel-match.sls']) - self.assertNotIn( - 'AttributeError: \'Matcher\' object has no ' - 'attribute \'functions\'', - ret - ) - @skipIf(os.geteuid() != 0, 'you must be root to run this test') def test_issue_2167_ipcidr_no_AttributeError(self): subnets = self.run_function('network.subnets')