Commit e8e249e0 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review

Merge "Convert integer style parameters to integer values"

parents 931ee4d6 b2fa6bf5
......@@ -18,6 +18,8 @@ import datetime
import logging
import re
from oslo_utils import strutils
from blazarclient import command
from blazarclient import exception
......@@ -162,12 +164,13 @@ class CreateLease(command.CreateCommand):
if not (phys_res_info['min'] and phys_res_info['max']):
raise exception.IncorrectLease(err_msg)
min_host = int(phys_res_info['min'])
max_host = int(phys_res_info['max'])
except Exception:
if not (strutils.is_int_like(phys_res_str['min']) and
raise exception.IncorrectLease(err_msg)
min_host = int(phys_res_info['min'])
max_host = int(phys_res_info['max'])
if min_host > max_host:
err_msg = ("Invalid physical-reservation argument '%s'. "
"Reservation argument min value must be "
......@@ -202,6 +205,8 @@ class CreateLease(command.CreateCommand):
k, v = kv_str.split("=", 1)
except ValueError:
raise exception.IncorrectLease(err_msg)
if strutils.is_int_like(v):
v = int(v)
res_info[k] = v
if reservations:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment