Remove remaining exsel code

This commit is contained in:
Pedro Algarvio 2014-05-29 01:32:54 +01:00
parent ab986e7aef
commit 7bd8b1360f
8 changed files with 2 additions and 41 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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')

View file

@ -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,

View file

@ -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:'
)

View file

@ -1,4 +0,0 @@
base:
test.ping:
- match: exsel
- test

View file

@ -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')