Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c7n - ValueFilter - add value_type: number #4744

Open
jomalsan opened this issue Sep 6, 2019 · 2 comments
Open

c7n - ValueFilter - add value_type: number #4744

jomalsan opened this issue Sep 6, 2019 · 2 comments

Comments

@jomalsan
Copy link
Collaborator

jomalsan commented Sep 6, 2019

I am working on a policy that returns a version in the format '1.X' and need to check if the version is less than 1.2. Currently the only value_type option for converting to numeric is integer which floors all of the version numbers to 1 so that they all pass the filter.

Feature request is for a new value_type option, number or float, that will support converting strings to floating point numbers.

@thisisshi
Copy link
Member

A semver value_type could probably work here,

https://github.com/pypa/packaging

from packaging import version

low = version.parse('0.1.0')
high = version.parse('0.1.1')

assert low < high

@stefangordon stefangordon added this to Triage in azure via automation Sep 7, 2019
@stefangordon
Copy link
Collaborator

stefangordon commented Sep 7, 2019

Yeah it might make sense to just add both a float and a semver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
azure
  
To do
Development

No branches or pull requests

3 participants