[ https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16001012#comment-16001012 ]
ASF GitHub Bot commented on ARIA-140: ------------------------------------- Github user tliron commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289271 --- Diff: aria/modeling/service_template.py --- @@ -2131,13 +2132,15 @@ def resolve(self, model_storage): # moved to. plugins = model_storage.plugin.list() matching_plugins = [] - for plugin in plugins: - # TODO: we need to use a version comparator - if (plugin.name == self.name) and \ - ((self.version is None) or (plugin.package_version >= self.version)): - matching_plugins.append(plugin) + if plugins: + for plugin in plugins: + if (plugin.name == self.name) and \ --- End diff -- I strongly disagree, especially in this case when there is `or` and `and` in the same clause. Do you otherwise expect the reader to know the priority of logical binary operations? Parentheses remove any potential confusion. > General purpose version comparison > ---------------------------------- > > Key: ARIA-140 > URL: https://issues.apache.org/jira/browse/ARIA-140 > Project: AriaTosca > Issue Type: Story > Reporter: Tal Liron > Assignee: Tal Liron > Priority: Minor > > Add {{aria.utils.versions}} to allow for general-purpose comparison and > sorting of version strings. > For now this will be used for resolving plugin specifications to plugins, but > it may very well have other uses in the future. -- This message was sent by Atlassian JIRA (v6.3.15#6346)