Skip to content

Commit e45fcaf

Browse files
authored
allow yaml files to have yaml extension (#833)
Signed-off-by: Riccardo Piccoli <[email protected]>
1 parent 40540dc commit e45fcaf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

kvirt/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ def create_vm(args):
15031503
pprint(f"Using {image} as profile")
15041504
profile = image
15051505
elif profile is not None:
1506-
if profile.endswith('.yml'):
1506+
if profile.endswith('.yml') or profile.endswith('.yaml'):
15071507
profilefile = profile
15081508
profile = None
15091509
if not os.path.exists(profilefile):

kvirt/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ def plan(self, plan, ansible=False, url=None, path=None, container=False, inputf
15501550
if url is not None:
15511551
if url.startswith('/'):
15521552
url = f"file://{url}"
1553-
if not url.endswith('.yml'):
1553+
if not url.endswith('.yml') and not url.endswith('.yaml'):
15541554
url = f"{url}/kcli_plan.yml"
15551555
pprint(f"Trying to retrieve {url}")
15561556
inputfile = os.path.basename(url)
@@ -1800,7 +1800,7 @@ def plan(self, plan, ansible=False, url=None, path=None, container=False, inputf
18001800
continue
18011801
elif planurl is not None:
18021802
path = planentry
1803-
if not planurl.endswith('yml'):
1803+
if not planurl.endswith('yml') and not planurl.endswith('yaml'):
18041804
planurl = f"{planurl}/kcli_plan.yml"
18051805
else:
18061806
path = os.path.dirname(planfile) or '.'

0 commit comments

Comments
 (0)