Skip to content

Commit 5acaf20

Browse files
committed
Reorder checks to report file errors first
1 parent 3b4e223 commit 5acaf20

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

linodecli/plugins/image-upload.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ def call(args, context):
8484
# get default region populated
8585
context.client.config.update(parsed)
8686

87-
if not parsed.region:
88-
print("No region provided. Please set a default region or use --region")
89-
exit(1)
90-
9187
# make sure the file exists and is ready to upload
9288
filepath = os.path.expanduser(parsed.file)
9389

@@ -100,6 +96,10 @@ def call(args, context):
10096
print("File {} is too large; compressed size must be less than 5GB".format(filepath))
10197
exit(2)
10298

99+
if not parsed.region:
100+
print("No region provided. Please set a default region or use --region")
101+
exit(1)
102+
103103
label = parsed.label or os.path.basename(filepath)
104104

105105
# generate an upload URL

0 commit comments

Comments
 (0)