'Search host dependency and make tuple according to it.'

def make_dep_tuple(self, parent, dependent, ptuple, dtuple, res):

    try:
        dependent_host_parent = self.get_host_dependency(dependent['host_object'])
        if (parent['host_name'] == dependent_host_parent):
            res = (ptuple, dtuple)
    except IndexError:
        if (parent['host_name'] == dependent['host_name']):
            res = (ptuple, dtuple)
    return res
