Coverage for lib/ansible/playbook/taggable.py : 47%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
super(Taggable, self).__init__()
elif isinstance(ds, string_types): value = ds.split(',') if isinstance(value, list): return [x.strip() for x in value] else: return [ds] else: raise AnsibleError('tags must be specified as a list', obj=ds)
''' this checks if the current item should be executed depending on tag options '''
if tags.find(',') != -1: tags = set(tags.split(',')) else: tags = set([tags]) else: else: # this makes isdisjoint work for untagged
elif not tags.isdisjoint(only_tags): should_run = True elif 'tagged' in only_tags and tags != self.untagged and 'never' not in tags: should_run = True else: should_run = False
# Check for tags that we need to skip if 'all' in skip_tags: if 'always' not in tags or 'always' in skip_tags: should_run = False elif not tags.isdisjoint(skip_tags): should_run = False elif 'tagged' in skip_tags and tags != self.untagged: should_run = False
|