Skip to content

Commit c426a1c

Browse files
jlebongursewak1997
authored andcommitted
cmd-buildfetch: populate tmp/builds-source.txt when not passing --url
We would write `args.url` to that file, but the user may not have passed an explicit `--url` and instead let the default logic kick in. Instead, just consistently use `args.url` in the fallback code so that the later logic that writes it out will pick up on it.
1 parent d49273c commit c426a1c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/cmd-buildfetch

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,20 @@ def main():
5555
if args.aws_config_file:
5656
os.environ["AWS_CONFIG_FILE"] = args.aws_config_file
5757

58-
url = args.url
59-
if not url:
58+
if not args.url:
6059
if args.build:
6160
stream = get_stream_for_build(args.build)
6261
if args.stream and stream != args.stream:
6362
raise Exception("A conflicting --build and --stream were provided")
6463
else:
6564
stream = args.stream or 'testing-devel'
66-
url = f'{FCOS_STREAMS_URL}/{stream}/builds'
67-
if url.startswith("s3://"):
68-
fetcher = S3Fetcher(url)
69-
elif url.startswith("http://") or url.startswith("https://"):
70-
fetcher = HTTPFetcher(url)
71-
elif url.startswith("file://") or url.startswith("/"):
72-
fetcher = LocalFetcher(url)
65+
args.url = f'{FCOS_STREAMS_URL}/{stream}/builds'
66+
if args.url.startswith("s3://"):
67+
fetcher = S3Fetcher(args.url)
68+
elif args.url.startswith("http://") or args.url.startswith("https://"):
69+
fetcher = HTTPFetcher(args.url)
70+
elif args.url.startswith("file://") or args.url.startswith("/"):
71+
fetcher = LocalFetcher(args.url)
7372
else:
7473
raise Exception("Invalid scheme: only file://, s3://, and http(s):// supported")
7574

0 commit comments

Comments
 (0)