Skip to content

Commit

Permalink
Merge pull request #207 from ligangty/cf
Browse files Browse the repository at this point in the history
Fix: re-index wrong usage of the type
  • Loading branch information
ligangty authored Apr 3, 2024
2 parents 0800dcc + 6566aac commit a669066
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions charon/pkgs/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ def re_index(
):
"""Refresh the index.html for the specified folder in the bucket.
"""
bucket_name = bucket[1]
prefix = bucket[2]
bucket_name = bucket.get("bucket")
prefix = bucket.get("prefix")
s3_client = S3Client(aws_profile=aws_profile, dry_run=dry_run)
real_prefix = prefix if prefix.strip() != "/" else ""
s3_folder = os.path.join(real_prefix, path)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cf_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_cf_maven_after_reindex(self):
)

re_index(
(TEST_BUCKET, TEST_BUCKET, "ga", "", "maven.repository.redhat.com"),
{"bucket": TEST_BUCKET, "prefix": "ga"},
"org/apache/httpcomponents/httpclient/", "maven"
)

Expand All @@ -67,7 +67,7 @@ def test_cf_npm_after_reindex(self):
)

re_index(
(TEST_BUCKET, TEST_BUCKET, "", "", "npm.registry.redhat.com"),
{"bucket": TEST_BUCKET, "prefix": ""},
"@babel/", "npm"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_maven_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_re_index(self):
Body="Just a test content"
)
re_index(
(TEST_BUCKET, TEST_BUCKET, "", "", None),
{"bucket": TEST_BUCKET, "prefix": ""},
commons_client_root, "maven"
)
indedx_obj = test_bucket.Object(COMMONS_CLIENT_INDEX)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_npm_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_re_index(self):
Key=test_file_path, Body="test content"
)
re_index(
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
{"bucket": TEST_BUCKET, "prefix": prefix},
"@babel/", "npm"
)
index_obj = test_bucket.Object(prefixed_namespace_babel_index)
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_re_index(self):
Key=test_file_path, Body="test content"
)
re_index(
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
{"bucket": TEST_BUCKET, "prefix": prefix},
"/", "npm"
)
index_obj = test_bucket.Object(prefixed_root_index)
Expand Down Expand Up @@ -284,7 +284,7 @@ def test_re_index(self):
Key=test_file_path, Body="test content"
)
re_index(
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
{"bucket": TEST_BUCKET, "prefix": prefix},
metadata_path, "npm"
)
objs = list(test_bucket.objects.all())
Expand Down

0 comments on commit a669066

Please sign in to comment.