Skip to content

Commit

Permalink
Display error message when manifest file path is incorrect
Browse files Browse the repository at this point in the history
Signed-off-by: Veena Saini <[email protected]>
  • Loading branch information
veenasai2 authored and Dmitrii Kuvaiskii committed Nov 29, 2021
1 parent 3c4f89a commit 21b30f2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ def gsc_build(args):
base_image_dict = toml.loads(base_image_environment)

user_manifest_contents = ''
if os.path.exists(args.manifest):
with open(args.manifest, 'r') as user_manifest_file:
user_manifest_contents = user_manifest_file.read()
if not os.path.exists(args.manifest):
raise FileNotFoundError(f'Manifest file {args.manifest} does not exist')
with open(args.manifest, 'r') as user_manifest_file:
user_manifest_contents = user_manifest_file.read()

user_manifest_dict = toml.loads(user_manifest_contents)

# Support deprecated syntax: replace old-style TOML-dict (`sgx.trusted_files.key = "file:foo"`)
Expand Down

0 comments on commit 21b30f2

Please sign in to comment.