Skip to content

Commit 1604c22

Browse files
Merge pull request #11 from JohnGemini/version_limitation
Remove the limitation of version when create/build a solution
2 parents fafceec + e04f348 commit 1604c22

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

gemini_solution_builder/version_mapping.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@
2222
latest_version = '1.0.0'
2323

2424

25-
def get_mapping():
25+
def get_mapping(version):
2626
# NOTE(eli): It's required not to have circular dependencies error
2727
from gemini_solution_builder.actions import build
2828
from gemini_solution_builder import validators
2929

30-
return [
31-
{'version': '1.0.0',
32-
'templates': ['templates/base', 'templates/v1/'],
33-
'validator': validators.ValidatorV1,
34-
'builder': build.BuildSolutionV1},
35-
]
30+
return {'version': version,
31+
'templates': ['templates/base', 'templates/v1/'],
32+
'validator': validators.ValidatorV1,
33+
'builder': build.BuildSolutionV1}
3634

3735

3836
def get_solution_for_version(version):
@@ -45,13 +43,13 @@ def get_solution_for_version(version):
4543
'validator' - validator class
4644
'builder' - builder class
4745
"""
48-
data = filter(lambda p: p['version'] == version, get_mapping())
46+
data = get_mapping(version)
4947

5048
if not data:
5149
raise errors.WrongPackageVersionError(
5250
'Wrong package version "{0}"'.format(version))
5351

54-
return data[0]
52+
return data
5553

5654

5755
def get_version_mapping_from_solution(solution_path):

0 commit comments

Comments
 (0)