Use enum class define microversions

Related-Bug: #1854121
Change-Id: I53b51e149be7252093aefcf2878684f42a3209c7
This commit is contained in:
licanwei
2019-11-28 16:48:27 +08:00
parent 4a269ba039
commit a2f1089038
2 changed files with 16 additions and 17 deletions

View File

@@ -164,7 +164,8 @@ def allow_start_end_audit_time():
Version 1.1 of the API added support for start and end time of continuous
audits.
"""
return pecan.request.version.minor >= versions.MINOR_1_START_END_TIMING
return pecan.request.version.minor >= (
versions.VERSIONS.MINOR_1_START_END_TIMING.value)
def allow_force():
@@ -173,4 +174,5 @@ def allow_force():
Version 1.2 of the API added support for forced audits that allows to
launch audit when other action plan is ongoing.
"""
return pecan.request.version.minor >= versions.MINOR_2_FORCE
return pecan.request.version.minor >= (
versions.VERSIONS.MINOR_2_FORCE.value)