Skip to content
Snippets Groups Projects

[RTADPA BW Tests] Upload the metadata yaml from nominal hlt2 bw tests, so that it can be accessed later by sprucing bw tests

Merged Luke Grazette requested to merge lugrazet-BW-hlt2-upload-metadata into master
All threads resolved!
Files
2
+ 12
4
@@ -17,17 +17,22 @@ def get_gitlab_server():
return gitlab.Gitlab(GITLAB_URL, private_token=os.getenv("GITLAB_TOKEN"))
def upload_eos_www(source, destination, baseurl=None):
def upload_eos_www(source, destination, baseurl=None, force=False):
"""Copy a file to EOS via xrdcp."""
baseurl = baseurl or os.getenv("LHCBPR_WWW_EOS")
if not baseurl:
log.error(f"LHCBPR_WWW_EOS env is not set. Will not upload {source} to EOS")
log.error(
f"LHCBPR_WWW_EOS env is not set. Will not upload {source} to EOS")
else:
# don't use urljoin here as it can't cope with root://
full_destination = os.path.join(baseurl, destination)
log.info(f"Uploading {source} to {full_destination}")
try:
cmd = ["xrdcp", source, full_destination]
cmd = ["xrdcp"]
if force:
# use case is to overwrite files already present
cmd.append("-f")
cmd += [source, full_destination]
log.debug("Calling {}".format(" ".join(map(repr, cmd))))
subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
@@ -47,7 +52,10 @@ def post_mattermost(message, webhook=None):
log.error(f"Failed to post to Mattermost: {e}")
def post_gitlab_feedback(trigger_source, message, add_labels=[], remove_labels=[]):
def post_gitlab_feedback(trigger_source,
message,
add_labels=[],
remove_labels=[]):
"""Post feedback to GitLab for a ci-test trigger.
Args:
Loading