Merge "Keypair_id should be a required option when creating a baymodel"
This commit is contained in:
commit
027a0a3cb9
|
@ -75,7 +75,8 @@ class BayModel(base.APIBase):
|
|||
dns_nameserver = wtypes.IPv4AddressType()
|
||||
"""The DNS nameserver address"""
|
||||
|
||||
keypair_id = wtypes.StringType(min_length=1, max_length=255)
|
||||
keypair_id = wsme.wsattr(wtypes.StringType(min_length=1, max_length=255),
|
||||
mandatory=True)
|
||||
"""The name or id of the nova ssh keypair"""
|
||||
|
||||
external_network_id = wtypes.StringType(min_length=1, max_length=255)
|
||||
|
|
|
@ -505,6 +505,12 @@ class TestPost(api_base.FunctionalTest):
|
|||
response = self.post_json('/baymodels', cdict, expect_errors=True)
|
||||
self.assertEqual(400, response.status_int)
|
||||
|
||||
def test_create_baymodel_without_keypair_id(self):
|
||||
cdict = apiutils.baymodel_post_data()
|
||||
del cdict['keypair_id']
|
||||
response = self.post_json('/baymodels', cdict, expect_errors=True)
|
||||
self.assertEqual(400, response.status_int)
|
||||
|
||||
|
||||
class TestDelete(api_base.FunctionalTest):
|
||||
|
||||
|
|
Loading…
Reference in New Issue