Merge pull request #1696 from gregorg/enhance_limit

Allow regex to be used to select hosts in addition to fnmatch pattern
This commit is contained in:
Michael DeHaan 2012-12-12 14:51:44 -08:00
commit 70bb7d1e54
4 changed files with 36 additions and 6 deletions

View file

@ -158,6 +158,14 @@ class TestInventory(unittest.TestCase):
print "EXPECTED=%s" % sorted(expected_hosts)
assert sorted(hosts) == sorted(expected_hosts)
def test_regex_exclude(self):
inventory = self.complex_inventory()
hosts = inventory.list_hosts("~rtp_[ac]")
expected_hosts = ['rtp_a', 'rtp_c']
print "HOSTS=%s" % sorted(hosts)
print "EXPECTED=%s" % sorted(expected_hosts)
assert sorted(hosts) == sorted(expected_hosts)
def test_complex_enumeration(self):