Remove type and image_id replace with baymodel_id

The baymodel_id represents the bay model used to generate this
particular Bay.  This is essentially a split of Bay into multiple
objects - one for template storage - one for instantation.

Change-Id: Ie6b7220bfecfd61af0ecf9114a791dfed61b415e
This commit is contained in:
Steven Dake 2014-12-16 20:59:39 -07:00
parent 3f520bbde5
commit 54e59ea12e
5 changed files with 8 additions and 16 deletions

View File

@ -77,14 +77,11 @@ class Bay(base.APIBase):
name = wtypes.text
"""Name of this bay"""
type = wtypes.text
"""Type of this bay"""
image_id = wtypes.text
"""The image name or UUID to use as a base image for this bay"""
baymodel_id = wtypes.text
"""The bay model UUID or id"""
node_count = wtypes.IntegerType()
"""The image name or UUID to use as a base image for this bay"""
"""The node count for this bay"""
links = wsme.wsattr([link.Link], readonly=True)
"""A list containing a self link and associated bay links"""

View File

@ -36,8 +36,7 @@ def upgrade():
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('uuid', sa.String(length=36), nullable=True),
sa.Column('name', sa.String(length=255), nullable=True),
sa.Column('type', sa.String(length=20), nullable=True),
sa.Column('image_id', sa.String(length=255), nullable=True),
sa.Column('baymodel_id', sa.String(length=255), nullable=True),
sa.Column('node_count', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint('id'),
mysql_ENGINE='InnoDB',

View File

@ -122,8 +122,7 @@ class Bay(Base):
id = Column(Integer, primary_key=True)
uuid = Column(String(36))
name = Column(String(255))
type = Column(String(20))
image_id = Column(String(255))
baymodel_id = Column(String(255))
node_count = Column(Integer())

View File

@ -35,8 +35,7 @@ class Bay(base.MagnumObject):
'id': int,
'uuid': obj_utils.str_or_none,
'name': obj_utils.str_or_none,
'type': obj_utils.str_or_none,
'image_id': obj_utils.str_or_none,
'baymodel_id': obj_utils.str_or_none,
'node_count': obj_utils.int_or_none
}

View File

@ -82,8 +82,8 @@ class TestBayController(db_base.DbTestCase):
with patch.object(api.API, 'bay_create') as mock_method:
# Create a bay
mock_method.side_effect = self.simulate_rpc_bay_create
params = '{"name": "bay_example_A", "type": "virt", \
"image_id": "Fedora", "node_count": "3"}'
params = '{"name": "bay_example_A", "baymodel_id": "12345", \
"node_count": "3"}'
response = self.app.post('/v1/bays',
params=params,
content_type='application/json')
@ -96,8 +96,6 @@ class TestBayController(db_base.DbTestCase):
c = response.json['bays'][0]
self.assertIsNotNone(c.get('uuid'))
self.assertEqual('bay_example_A', c.get('name'))
self.assertEqual('virt', c.get('type'))
self.assertEqual('Fedora', c.get('image_id'))
self.assertEqual(3, c.get('node_count'))
# Get just the one we created