From 6d38ff428d56b1e2cad7339ec8c65c318f5b0cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 8 Sep 2023 11:09:34 +0200 Subject: [PATCH 1/3] pass staging repo to eessitarball --- scripts/automated_ingestion/automated_ingestion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/automated_ingestion/automated_ingestion.py b/scripts/automated_ingestion/automated_ingestion.py index 1596bf3d..561316e9 100755 --- a/scripts/automated_ingestion/automated_ingestion.py +++ b/scripts/automated_ingestion/automated_ingestion.py @@ -92,7 +92,7 @@ def main(): logging.basicConfig(filename=log_file, format=log_format, level=log_level) # TODO: check configuration: secrets, paths, permissions on dirs, etc gh_pat = config['secrets']['github_pat'] - gh = github.Github(gh_pat) + gh_staging_repo = github.Github(gh_pat).get_repo(config['github']['staging_repo']) s3 = boto3.client( 's3', aws_access_key_id=config['secrets']['aws_access_key_id'], @@ -107,7 +107,7 @@ def main(): print(f'[{bucket}] {num}: {tarball}') else: for tarball in tarballs: - tar = EessiTarball(tarball, config, gh, s3, bucket) + tar = EessiTarball(tarball, config, gh_staging_repo, s3, bucket) tar.run_handler() From 97f072f538ef70e1baa756bd3d2a3e4cc69217fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 8 Sep 2023 11:10:20 +0200 Subject: [PATCH 2/3] assume staging repo is being passed to eessitarball --- scripts/automated_ingestion/eessitarball.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/automated_ingestion/eessitarball.py b/scripts/automated_ingestion/eessitarball.py index 9cac87a5..15b59c1a 100644 --- a/scripts/automated_ingestion/eessitarball.py +++ b/scripts/automated_ingestion/eessitarball.py @@ -19,11 +19,11 @@ class EessiTarball: for which it interfaces with the S3 bucket, GitHub, and CVMFS. """ - def __init__(self, object_name, config, github, s3, bucket): + def __init__(self, object_name, config, git_staging_repo, s3, bucket): """Initialize the tarball object.""" self.config = config self.github = github - self.git_repo = github.get_repo(config['github']['staging_repo']) + self.git_repo = git_staging_repo self.metadata_file = object_name + config['paths']['metadata_file_extension'] self.object = object_name self.s3 = s3 From efd9a5b3e6605212c3112e9a0b299ed45aa1f4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 8 Sep 2023 11:10:35 +0200 Subject: [PATCH 3/3] remove self.github, which wasn't used --- scripts/automated_ingestion/eessitarball.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/automated_ingestion/eessitarball.py b/scripts/automated_ingestion/eessitarball.py index 15b59c1a..6b0857dd 100644 --- a/scripts/automated_ingestion/eessitarball.py +++ b/scripts/automated_ingestion/eessitarball.py @@ -22,7 +22,6 @@ class EessiTarball: def __init__(self, object_name, config, git_staging_repo, s3, bucket): """Initialize the tarball object.""" self.config = config - self.github = github self.git_repo = git_staging_repo self.metadata_file = object_name + config['paths']['metadata_file_extension'] self.object = object_name