mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
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:
commit
70bb7d1e54
4 changed files with 36 additions and 6 deletions
|
@ -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):
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue