<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def linkify_hd_by_h(self, hosts):
 """Replace dependent_host_name and host_name in host dependency by the real object :param hosts: host list, used to look for a specific one :type hosts: alignak.objects.host.Hosts :return: None """

        for hostdep in self:
            try:
                h_name = hostdep.host_name
                dh_name = hostdep.dependent_host_name
                host = hosts.find_by_name(h_name)
                if host is None:
                    err = "Error: the host dependency got a bad host_name definition '%s'" % h_name
                    hostdep.add_error(err)
                dephost = hosts.find_by_name(dh_name)
                if dephost is None:
                    err = "Error: the host dependency got " \
                          "a bad dependent_host_name definition '%s'" % dh_name
                    hostdep.add_error(err)
                if host:
                    hostdep.host_name = host.uuid
                if dephost:
                    hostdep.dependent_host_name = dephost.uuid
            except AttributeError as exp:
                err = "Error: the host dependency miss a property '%s'" % exp
                hostdep.add_error(err)