Commit 9d99e434 authored by Zuul's avatar Zuul Committed by Gerrit Code Review

Merge "Support update lease API for instance reservation plugin"

parents 868d2934 a46724a5
......@@ -139,7 +139,7 @@ class UpdateLeaseTestCase(tests.TestCase):
self.assertDictEqual(self.cl.args2body(args), expected)
def test_args2body_reservation_params(self):
def test_args2body_host_reservation_params(self):
args = argparse.Namespace(
name=None,
prolong_for=None,
......@@ -173,3 +173,33 @@ class UpdateLeaseTestCase(tests.TestCase):
}
self.assertDictEqual(self.cl.args2body(args), expected)
def test_args2body_instance_reservation_params(self):
args = argparse.Namespace(
name=None,
prolong_for=None,
reduce_by=None,
end_date=None,
defer_by=None,
advance_by=None,
start_date=None,
reservation=[
'id=798379a6-194c-45dc-ba34-1b5171d5552f,'
'vcpus=3,memory_mb=1024,disk_gb=20,'
'amount=4,affinity=False'
]
)
expected = {
'reservations': [
{
'id': '798379a6-194c-45dc-ba34-1b5171d5552f',
'vcpus': 3,
'memory_mb': 1024,
'disk_gb': 20,
'amount': 4,
'affinity': 'False'
}
]
}
self.assertDictEqual(self.cl.args2body(args), expected)
......@@ -357,8 +357,8 @@ class UpdateLease(command.UpdateCommand):
'id',
# Keys for host reservation
'min', 'max', 'hypervisor_properties', 'resource_properties',
# Keys for instance reservation (update of instance reservation
# is NOT yet supported)
# Keys for instance reservation
'vcpus', 'memory_mb', 'disk_gb', 'amount', 'affinity'
]
params['reservations'] = []
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