'Write a file to the VM instance.'

def inject_file(self, instance, path, contents):

    if self.agent_enabled(instance):
        vm_ref = self._get_vm_opaque_ref(instance)
        agent = self._get_agent(instance, vm_ref)
        agent.inject_file(path, contents)
    else:
        raise NotImplementedError()
