
from __future__ import absolute_import
from __future__ import division

from vdsm.common import exception


def require_keys(params, keys):
    missing = [key for key in keys if key not in params]
    if missing:
        raise exception.MissingParameter(missing=missing, params=params)


def normalize_pci_address(domain, bus, slot, function):
    if all(v.startswith('0x') for v in (domain, bus, slot, function)):
        base = 16
    elif all(not v.startswith('0x') for v in (domain, bus, slot, function)):
        base = 10
    else:
        raise ValueError('unsupported address format')
    return {
    }
