コード例 #1
0
    def test_metal_ips_kept(self):
        mi.remove_ip_addresses(self.inv)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_networks = 'container_networks' in variables
            if not variables.get('is_metal', False):
                continue
            self.assertTrue(has_networks)
コード例 #2
0
    def test_ansible_host_vars_removed(self):
        mi.remove_ip_addresses(self.inv)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_host = 'ansible_host' in variables
            if variables.get('is_metal', False):
                continue
            self.assertFalse(has_host)
コード例 #3
0
    def test_ansible_host_vars_removed(self):
        mi.remove_ip_addresses(self.inv)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_host = 'ansible_host' in variables
            if variables.get('is_metal', False):
                continue
            self.assertFalse(has_host)
コード例 #4
0
    def test_metal_ips_kept(self):
        mi.remove_ip_addresses(self.inv)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_networks = 'container_networks' in variables
            if not variables.get('is_metal', False):
                continue
            self.assertTrue(has_networks)
コード例 #5
0
    def test_ips_removed(self):
        mi.remove_ip_addresses(self.inv)
        mi.remove_ip_addresses(self.inv, TARGET_DIR)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_networks = 'container_networks' in variables
            if variables.get('is_metal', False):
                continue
            self.assertFalse(has_networks)
コード例 #6
0
    def test_ips_removed(self):
        mi.remove_ip_addresses(self.inv)
        mi.remove_ip_addresses(self.inv, TARGET_DIR)
        hostvars = self.inv['_meta']['hostvars']

        for host, variables in hostvars.items():
            has_networks = 'container_networks' in variables
            if variables.get('is_metal', False):
                continue
            self.assertFalse(has_networks)
コード例 #7
0
 def test_multiple_calls(self):
     """Removal should fail silently if keys are absent."""
     mi.remove_ip_addresses(self.inv)
     mi.remove_ip_addresses(self.inv)
コード例 #8
0
 def test_multiple_calls(self):
     """Removal should fail silently if keys are absent."""
     mi.remove_ip_addresses(self.inv)
     mi.remove_ip_addresses(self.inv)