Turn None into an empty string (for minion matching) #38659

merged 1 commit into from Jan 15, 2017


None yet

2 participants

techhat commented Jan 10, 2017

What does this PR do?

check_minions() does string checking on the expr. If expr is None, then the string checking will fail, so we switch it to an empty string instead.

What issues does this PR fix or reference?


Previous Behavior

[ERROR   ] Failed matching available minions with glob pattern: None
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/utils/minions.py", line 650, in check_minions
    minions = check_func(expr, greedy)
  File "/usr/lib/python2.7/site-packages/salt/utils/minions.py", line 202, in _check_glob_minions
    return fnmatch.filter(self._pki_minions(), expr)
  File "/usr/lib/python2.7/fnmatch.py", line 53, in filter
    res = translate(pat)
  File "/usr/lib/python2.7/fnmatch.py", line 91, in translate
    i, n = 0, len(pat)
TypeError: object of type 'NoneType' has no len()

New Behavior

(not that)

Tests written?


@techhat techhat Turn None into an empty string (for minion matching)
@cachedout cachedout merged commit 8b38cfe into saltstack:2016.11 Jan 15, 2017

3 of 4 checks passed

default Build started sha1 is merged.
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #5464 — SUCCESS
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt Linode Ubuntu14.04 #5106 — SUCCESS
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #5464 — SUCCESS
@techhat techhat deleted the techhat:issue38216 branch Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment