def filterByCloud(metalist, cmdargs):
    """
    Filter the meta objects by cloud amount. If no cloud amount present, then
    all are acceptable (e.g. for Sentinel-1)
    
    """
    metalistFiltered = []
    for (urlStr, metaObj) in metalist:
        cloudPcnt = None
        if hasattr(metaObj, 'cloudCoverPcnt'):
            cloudPcnt = metaObj.cloudCoverPcnt
        if cloudPcnt is None or cloudPcnt <= cmdargs.maxcloud:
            metalistFiltered.append((urlStr, metaObj))
    return metalistFiltered