[arvados] updated: 2.1.0-3012-gaa72f220d
git repository hosting
git at public.arvados.org
Mon Nov 7 21:59:20 UTC 2022
Summary of changes:
sdk/cwl/arvados_cwl/http.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
via aa72f220d4b479998e14b1727920f7684f338d15 (commit)
from 60cd74f05a391d0e6eba3e6b1896fd88c0dd53c2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit aa72f220d4b479998e14b1727920f7684f338d15
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Mon Nov 7 16:59:05 2022 -0500
19699: Tighten up etag handling a bit
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/sdk/cwl/arvados_cwl/http.py b/sdk/cwl/arvados_cwl/http.py
index d85ae30d2..33aa09884 100644
--- a/sdk/cwl/arvados_cwl/http.py
+++ b/sdk/cwl/arvados_cwl/http.py
@@ -88,6 +88,14 @@ def changed(url, properties, now):
return True
+def etag_quote(etag):
+ # if it already has leading and trailing quotes, do nothing
+ if etag[0] == '"' and etag[-1] == '"':
+ return etag
+ else:
+ # Add quotes.
+ return '"' + etag + '"'
+
def http_to_keep(api, project_uuid, url, utcnow=datetime.datetime.utcnow):
r = api.collections().list(filters=[["properties", "exists", url]]).execute()
@@ -108,13 +116,13 @@ def http_to_keep(api, project_uuid, url, utcnow=datetime.datetime.utcnow):
cr = arvados.collection.CollectionReader(item["portable_data_hash"], api_client=api)
return "keep:%s/%s" % (item["portable_data_hash"], list(cr.keys())[0])
- if "ETag" in properties:
+ if "ETag" in properties and len(properties["ETag"]) > 2:
etags[properties["ETag"]] = item
properties = {}
headers = {}
if etags:
- headers['If-None-Match'] = ', '.join(['"%s"' % k for k,v in etags.items()])
+ headers['If-None-Match'] = ', '.join([etag_quote(k) for k,v in etags.items()])
req = requests.get(url, stream=True, allow_redirects=True, headers=headers)
if req.status_code not in (200, 304):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list