ucscsdk/utils/ucscfirmware.py
def _validate_firmware_bundle(handle, bundle_type, version):
    '''
    Internal function to validate firmware bundle for domain fw_update
    '''
    if bundle_type == "catalog":
        filter_str = '(type, %s, type="eq")' % "catalog"
    else:
        filter_infra = '(type, %s, type="eq")' % "infrastructure-bundle"
        if bundle_type == "classic":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-infra"
        if bundle_type == "mini":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-mini-infra"
        if bundle_type == "classic-3gen":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-6300-infra"

        filter_str = filter_infra + " and " + filter_bundle

    bundles = handle.query_classid(
        class_id="FirmwareDistributable", filter_str=filter_str)
    for bundle in bundles:
        if bundle.version == version:
            return True
    raise UcscOperationError(
        "Validate firmware bundle",
        "Bundle %s not available on UCS Central" %
        version)

    Internal function to validate firmware bundle for domain fw_update
    
Internal function to validate firmware bundle for domain fw_update
Internal function to validate firmware bundle for domain fw_update
def _validate_firmware_bundle(handle, bundle_type, version):
    if bundle_type == "catalog":
        filter_str = '(type, %s, type="eq")' % "catalog"
    else:
        filter_infra = '(type, %s, type="eq")' % "infrastructure-bundle"
        if bundle_type == "classic":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-infra"
        if bundle_type == "mini":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-mini-infra"
        if bundle_type == "classic-3gen":
            filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-6300-infra"
        filter_str = filter_infra + " and " + filter_bundle
    bundles = handle.query_classid(
        class_id="FirmwareDistributable", filter_str=filter_str)
    for bundle in bundles:
        if bundle.version == version:
            return True
    raise UcscOperationError(
        "Validate firmware bundle",
        "Bundle %s not available on UCS Central" %
        version)
def _validate_firmware_bundle ( handle , bundle_type , version ) : if bundle_type == "catalog" : filter_str = '(type, %s, type="eq")' % "catalog" else : filter_infra = '(type, %s, type="eq")' % "infrastructure-bundle" if bundle_type == "classic" : filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-infra" if bundle_type == "mini" : filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-mini-infra" if bundle_type == "classic-3gen" : filter_bundle = '(inv_tag, %s, type="eq")' % "bundle-6300-infra" filter_str = filter_infra + " and " + filter_bundle bundles = handle . query_classid ( class_id = "FirmwareDistributable" , filter_str = filter_str ) for bundle in bundles : if bundle . version == version : return True raise UcscOperationError ( "Validate firmware bundle" , "Bundle %s not available on UCS Central" % version )
Internal function to validate firmware bundle for domain fw_update
Internal function to validate firmware bundle for domain fw_update
'''
    Internal function to validate firmware bundle for domain fw_update
    '''
handle
bundle_type
version