Compare commits

...

1 Commits

Author SHA1 Message Date
Joseph Snyder
deb3f0f43a Prevent S3 information on non-S3 mirrors
Switch from looking at the presence of the S3 information keys to
determine if the dictionary URL is used to instead look at the value
in the keys.

Add s3_endpoint_url as an additional key value for the S3 information.
2022-01-10 12:48:51 -05:00

View File

@@ -530,11 +530,16 @@ def add(name, url, scope, args={}):
items = [(n, u) for n, u in mirrors.items()]
mirror_data = url
key_values = ["s3_access_key_id", "s3_access_token", "s3_profile"]
key_values = ["s3_access_key_id",
"s3_access_token",
"s3_profile",
"s3_endpoint_url"]
# On creation, assume connection data is set for both
if any(value for value in key_values if value in args):
# Check for value in each key, instead of presence of each key
if any(vars(args)[value] for value in key_values if value in args):
url_dict = {"url": url,
"access_pair": (args.s3_access_key_id, args.s3_access_key_secret),
"access_pair": (args.s3_access_key_id,
args.s3_access_key_secret),
"access_token": args.s3_access_token,
"profile": args.s3_profile,
"endpoint_url": args.s3_endpoint_url}