Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
idna / lib / python2.7 / site-packages / nova / pci / whitelist.pyc
Size: Mime:
ó
±EYc@s{ddlmZddlZddlmZddlmZddlmZej	j
Z
defd„ƒYZd„Z
dS(	iÿÿÿÿ(t	jsonutilsN(t	exception(t_(tdevspect	WhitelistcBs5eZdZd„Zdd„Zd„Zd„ZRS(s#White list class to decide assignable pci devices.

    Not all devices on compute node can be assigned to guest, the
    cloud administrator decides the devices that can be assigned
    based on vendor_id or product_id etc. If no white list specified,
    no device will be assignable.
    cCsg}xõ|D]í}ytj|ƒ}Wn-tk
rUtjdtdƒ|ƒ‚nXt|tƒrq|g}n.t|tƒsŸtjdtdƒ|ƒ‚nxX|D]P}t|tƒsÚtjdtdƒ|ƒ‚nt	j
|ƒ}|j|ƒq¦Wq
W|S(s:Parse and validate the pci whitelist from the nova config.treasonsInvalid entry: '%s's+Invalid entry: '%s'; Expecting list or dicts#Invalid entry: '%s'; Expecting dict(Rtloadst
ValueErrorRtPciConfigInvalidWhitelistRt
isinstancetdicttlistRt
PciDeviceSpectappend(tselft
whiteliststspecstjsonspectdev_spectdstspec((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pyt_parse_white_list_from_config%s*

			

		
cCs;tt|ƒjƒ|r.|j|ƒ|_n	g|_dS(s½White list constructor

        For example, followed json string specifies that devices whose
        vendor_id is '8086' and product_id is '1520' can be assigned
        to guest.
        '[{"product_id":"1520", "vendor_id":"8086"}]'

        :param whitelist_spec: A json string for a list of dictionaries,
                               each dictionary specifies the pci device
                               properties requirement.
        N(tsuperRt__init__RR(Rtwhitelist_spec((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pyR@scCs+x$|jD]}|j|ƒr
tSq
WtS(syCheck if a device can be assigned to a guest.

        :param dev: A dictionary describing the device properties
        (RtmatchtTruetFalse(RtdevR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pytdevice_assignableRscCs+x$|jD]}|j|ƒr
|Sq
WdS(N(Rt
match_pci_obj(Rtpci_devR((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pytget_devspec\sN(t__name__t
__module__t__doc__RtNoneRRR (((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pyRs
		
cCsttjƒ}|j|ƒS(N(RtCONFtpci_passthrough_whitelistR (Rt
dev_filter((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pytget_pci_device_devspecbs(toslo_serializationRt	nova.conftnovaRt	nova.i18nRtnova.pciRtconfR%tobjectRR((((sG/home/tvault/.virtenv/lib/python2.7/site-packages/nova/pci/whitelist.pyt<module>sG