File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3207,7 +3207,9 @@ def load_template(name: str) -> Template:
3207
3207
raise LoadTemplateError ("Could not load template {}: {}" .format (name , ex ))
3208
3208
return _parse_yaml_template (name , response .text )
3209
3209
3210
- if has_plugin_prefix (name ):
3210
+ potential_path = pathlib .Path (name )
3211
+
3212
+ if has_plugin_prefix (name ) and not potential_path .exists ():
3211
3213
prefix , rest = name .split (":" , 1 )
3212
3214
loaders = get_template_loaders ()
3213
3215
if prefix not in loaders :
@@ -3218,12 +3220,11 @@ def load_template(name: str) -> Template:
3218
3220
except Exception as ex :
3219
3221
raise LoadTemplateError ("Could not load template {}: {}" .format (name , ex ))
3220
3222
3221
- # First try local file
3222
- potential_path = pathlib .Path (name )
3223
+ # Try local file
3223
3224
if potential_path .exists ():
3224
3225
path = potential_path
3225
3226
else :
3226
- # Look for in template_dir()
3227
+ # Look for template in template_dir()
3227
3228
path = template_dir () / f"{ name } .yaml"
3228
3229
if not path .exists ():
3229
3230
raise LoadTemplateError (f"Invalid template: { name } " )
You can’t perform that action at this time.
0 commit comments