Skip to content

Commit fb6cde7

Browse files
Fix handling of cname parsing (#115)
In case only a platform and architecture or alternatively one feature is given the parser is now handling it based on the `gardenlinux.constants.ARCHS` list. Signed-off-by: Tobias Wolf <[email protected]>
1 parent a57efbd commit fb6cde7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/gardenlinux/features/cname.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from typing import Optional
44
import re
55

6+
from ..constants import ARCHS
7+
68

79
class CName(object):
810
def __init__(self, cname, arch=None, version=None):
@@ -25,10 +27,10 @@ def __init__(self, cname, arch=None, version=None):
2527
self._flavor = re_match[1]
2628
self._version = re_match[6]
2729

28-
if re_match[2] is None:
29-
self._flavor += re_match[3]
30-
else:
30+
if re_match[4] in ARCHS:
3131
self._arch = re_match[4]
32+
else:
33+
self._flavor += re_match[3]
3234

3335
if self._arch is None and arch is not None:
3436
self._arch = arch

0 commit comments

Comments
 (0)