From 3156921a02b3fe1a08ceb0426079911ccda656fd Mon Sep 17 00:00:00 2001 From: Matt Prahl Date: Mon, 16 Jan 2017 14:45:32 -0500 Subject: [PATCH] Support new nomenclature on get_module function when passing in a modulemd --- module_build_service/pdc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module_build_service/pdc.py b/module_build_service/pdc.py index 654aab2b..a255549d 100644 --- a/module_build_service/pdc.py +++ b/module_build_service/pdc.py @@ -95,7 +95,14 @@ def get_variant_dict(data): result = variant_dict_from_str(data) elif is_modulemd(data): - result = {'variant_id': data.name, 'variant_version': data.version, 'variant_release': data.release } + result = {'variant_id': data.name} + # Check if this is an old modulemd that doesn't use the new nomenclature + if hasattr(data, 'release'): + result['variant_release'] = data.release + result['variant_version'] = data.version + else: + result['variant_release'] = data.version + result['variant_version'] = data.stream elif is_variant_dict(data): result = data.copy()