Skip to content

Commit cf82f7d

Browse files
committed
Fixed issue with wrong example_uploads.yaml path.
Changelog: Fixed
1 parent 9e8c06f commit cf82f7d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nomad/cli/dev.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,19 @@ def gui_config():
263263
def _generate_example_upload_metadata():
264264
import yaml
265265

266-
with open(
267-
os.path.join(
266+
example_uploads_path = 'examples/data/uploads/example_uploads.yml'
267+
268+
if not os.path.exists(example_uploads_path):
269+
example_uploads_path = os.path.join(
268270
os.path.dirname(__file__),
269271
'../../',
270272
'examples/data/uploads/example_uploads.yml',
271273
)
272-
) as infile:
274+
275+
if not os.path.exists(example_uploads_path):
276+
raise FileNotFoundError('Cannot find example_uploads.yml file')
277+
278+
with open(example_uploads_path, 'r') as infile:
273279
return yaml.load(infile, Loader=yaml.SafeLoader)
274280

275281

0 commit comments

Comments
 (0)