'Parse and validate the pci whitelist from the nova config.'

def _parse_white_list_from_config(self, whitelists):

    specs = []
    for jsonspec in whitelists:
        try:
            dev_spec = jsonutils.loads(jsonspec)
        except ValueError:
            raise exception.PciConfigInvalidWhitelist(reason=(_("Invalid    entry:    '%s'") % jsonspec))
        if isinstance(dev_spec, dict):
            dev_spec = [dev_spec]
        elif (not isinstance(dev_spec, list)):
            raise exception.PciConfigInvalidWhitelist(reason=(_("Invalid    entry:    '%s';    Expecting    list    or    dict") % jsonspec))
        for ds in dev_spec:
            if (not isinstance(ds, dict)):
                raise exception.PciConfigInvalidWhitelist(reason=(_("Invalid    entry:    '%s';    Expecting    dict") % ds))
            spec = devspec.PciDeviceSpec(ds)
            specs.append(spec)
    return specs
