def _compare_product_version(hyper_version, image_props): version_required = image_props.get('hypervisor_version_requires') if not(hypervisor_version and version_required): return True img_prop_predicate = versionpredicate.VersionPredicate( 'image_prop (%s)' % version_required) hyper_ver_str = utils.convert_version_to_str(hyper_version) return img_prop_predicate.satisfied_by(hyper_ver_str)
def _compare_product_version(hyper_version, image_props): version_required = image_props.get('hypervisor_version_requires') if not (hypervisor_version and version_required): return True img_prop_predicate = versionpredicate.VersionPredicate( 'image_prop (%s)' % version_required) hyper_ver_str = utils.convert_version_to_str(hyper_version) return img_prop_predicate.satisfied_by(hyper_ver_str)
def test_convert_version_to_string(self): self.assertEqual(utils.convert_version_to_str(6007000), '6.7.0') self.assertEqual(utils.convert_version_to_str(4), '4')