Resolve device profiles by alias when the reference includes a .yaml extension
This commit is contained in:
1 parent
219fdf003e
commit
fc351246e9
1 file changed
+6
-1
+6
-1
@@ -126,8 +126,13 @@ def resolve_profile(reference, kind):
|
|||||||
|
|
||||||
|
|
||||||
def _slug(value):
|
def _slug(value):
|
||||||
|
text = str(value)
|
||||||
|
for suffix in (".yaml", ".yml"):
|
||||||
|
if text.lower().endswith(suffix):
|
||||||
|
text = text[: -len(suffix)]
|
||||||
|
break
|
||||||
return "".join(
|
return "".join(
|
||||||
char.lower() if char.isalnum() else "-" for char in str(value)
|
char.lower() if char.isalnum() else "-" for char in text
|
||||||
).strip("-")
|
).strip("-")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user