Commit a46724a5 authored by Masahito Muroi's avatar Masahito Muroi Committed by Pierre Riteau

Support update lease API for instance reservation plugin

This patch adds instance reservation update support to the Blazar
command-line client.

Change-Id: I2a5ab7f6d05c0351930f69d894005329ed637dd7
Depends-On: Ibdf7a730ae45ff6d8c17de62b0fc69262df2db79
parent b6c64637
......@@ -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