def assert_inventory_host_var(self, inventory, section, host, variable):
        # Config parser splits on the first "=", so we end up with:
        #   'hostname key1' -> 'val1 key2=val2 key3=val3'
        #
        # Convert to something easier to test:
        for (a, b) in inventory.items(section):
            full_line = "%s=%s" % (a, b)
            tokens = full_line.split()
            if tokens[0] == host:
                found = False
                for token in tokens:
                    if token == variable:
                        found = True
                        continue
                self.assertTrue("Unable to find %s in line: %s" %
                                (variable, full_line), found)
                return
        self.fail("unable to find host %s in inventory" % host)
dataset/ETHPy150Open openshift/openshift-ansible/utils/test/cli_installer_tests.py/AttendedCliTests.assert_inventory_host_var/original