def _get_vm_mdo(vm_ref):
    """Gets the Virtual Machine with the ref from the db."""
    if _db_content.get("VirtualMachine", None) is None:
            raise exception.NotFound("There is no VM registered")
    if vm_ref not in _db_content.get("VirtualMachine"):
        raise exception.NotFound("Virtual Machine with ref %s is not "
                                 "there" % vm_ref)
    return _db_content.get("VirtualMachine")[vm_ref]
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/vmwareapi/fake.py/_get_vm_mdo/original