Skip to content

Commit a669066

Browse files
authored
Merge pull request #207 from ligangty/cf
Fix: re-index wrong usage of the type
2 parents 0800dcc + 6566aac commit a669066

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

charon/pkgs/indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def re_index(
270270
):
271271
"""Refresh the index.html for the specified folder in the bucket.
272272
"""
273-
bucket_name = bucket[1]
274-
prefix = bucket[2]
273+
bucket_name = bucket.get("bucket")
274+
prefix = bucket.get("prefix")
275275
s3_client = S3Client(aws_profile=aws_profile, dry_run=dry_run)
276276
real_prefix = prefix if prefix.strip() != "/" else ""
277277
s3_folder = os.path.join(real_prefix, path)

tests/test_cf_reindex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_cf_maven_after_reindex(self):
4242
)
4343

4444
re_index(
45-
(TEST_BUCKET, TEST_BUCKET, "ga", "", "maven.repository.redhat.com"),
45+
{"bucket": TEST_BUCKET, "prefix": "ga"},
4646
"org/apache/httpcomponents/httpclient/", "maven"
4747
)
4848

@@ -67,7 +67,7 @@ def test_cf_npm_after_reindex(self):
6767
)
6868

6969
re_index(
70-
(TEST_BUCKET, TEST_BUCKET, "", "", "npm.registry.redhat.com"),
70+
{"bucket": TEST_BUCKET, "prefix": ""},
7171
"@babel/", "npm"
7272
)
7373

tests/test_maven_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_re_index(self):
178178
Body="Just a test content"
179179
)
180180
re_index(
181-
(TEST_BUCKET, TEST_BUCKET, "", "", None),
181+
{"bucket": TEST_BUCKET, "prefix": ""},
182182
commons_client_root, "maven"
183183
)
184184
indedx_obj = test_bucket.Object(COMMONS_CLIENT_INDEX)

tests/test_npm_index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_re_index(self):
223223
Key=test_file_path, Body="test content"
224224
)
225225
re_index(
226-
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
226+
{"bucket": TEST_BUCKET, "prefix": prefix},
227227
"@babel/", "npm"
228228
)
229229
index_obj = test_bucket.Object(prefixed_namespace_babel_index)
@@ -253,7 +253,7 @@ def test_re_index(self):
253253
Key=test_file_path, Body="test content"
254254
)
255255
re_index(
256-
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
256+
{"bucket": TEST_BUCKET, "prefix": prefix},
257257
"/", "npm"
258258
)
259259
index_obj = test_bucket.Object(prefixed_root_index)
@@ -284,7 +284,7 @@ def test_re_index(self):
284284
Key=test_file_path, Body="test content"
285285
)
286286
re_index(
287-
(TEST_BUCKET, TEST_BUCKET, prefix, "", None),
287+
{"bucket": TEST_BUCKET, "prefix": prefix},
288288
metadata_path, "npm"
289289
)
290290
objs = list(test_bucket.objects.all())

0 commit comments

Comments
 (0)