'Calls resetnetwork method in agent.'

def reset_network(self, instance, rescue=False):

    if self.agent_enabled(instance):
        vm_ref = self._get_vm_opaque_ref(instance)
        agent = self._get_agent(instance, vm_ref)
        self._inject_hostname(instance, vm_ref, rescue)
        agent.resetnetwork()
        self._remove_hostname(instance, vm_ref)
    else:
        raise NotImplementedError()
