Will,

On Tue, 2016-10-25 at 06:50 -0700, Will Thames wrote:
> I would not expect "2.1.2"|version_compare('2.1', '==') to return
> true as they are not equal.

ok, agreed.

However, what about:

"2.1.0"|version_compare('2.1', '==')

I would expect that to return true, but it currently evaluates to
false.

It gets even more interesting. Setting 'strict=True':

"2.1.0"|version_compare('2.1', '==', strict=True)

returns true. Intuitively, one would think that using 'stric=True'
would return false since 2.1.0 and 2.1 are not strictly the same
version.

Is this really the desired behaviour?

FWIW, I'm using Ansible 2.2.0 RC2.

> For what you want, you could use
> 
> ansible_ver | version_compare('2.1', '>=') and ansible_ver |
> version_compare('2.2', '<')

Thanks for the tip!

Regards,
Tadej Janež

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to