Merge "Add cert_uuid attributes to Bay in db"
This commit is contained in:
commit
45eca541b0
|
@ -40,7 +40,8 @@ class BayPatchType(types.JsonPatchType):
|
|||
@staticmethod
|
||||
def internal_attrs():
|
||||
internal_attrs = ['/api_address', '/node_addresses',
|
||||
'/master_addresses', '/stack_id']
|
||||
'/master_addresses', '/stack_id',
|
||||
'/ca_cert_uuid', '/magnum_cert_uuid']
|
||||
return types.JsonPatchType.internal_attrs() + internal_attrs
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Add cert_uuuid to bay
|
||||
|
||||
Revision ID: 6f21dc920bb
|
||||
Revises: 966a99e70ff
|
||||
Create Date: 2015-08-19 13:57:14.863292
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6f21dc920bb'
|
||||
down_revision = '966a99e70ff'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
'bay',
|
||||
sa.Column('ca_cert_uuid', sa.String(length=36), nullable=True))
|
||||
op.add_column(
|
||||
'bay',
|
||||
sa.Column('magnum_cert_uuid', sa.String(length=36), nullable=True))
|
|
@ -133,6 +133,8 @@ class Bay(Base):
|
|||
status_reason = Column(Text)
|
||||
discovery_url = Column(String(255))
|
||||
master_addresses = Column(JSONEncodedList)
|
||||
ca_cert_uuid = Column(String(36))
|
||||
magnum_cert_uuid = Column(String(36))
|
||||
|
||||
|
||||
class BayLock(Base):
|
||||
|
|
|
@ -60,6 +60,8 @@ class Bay(base.MagnumPersistentObject, base.MagnumObject,
|
|||
'master_count': fields.IntegerField(nullable=True),
|
||||
'discovery_url': fields.StringField(nullable=True),
|
||||
'master_addresses': fields.ListOfStringsField(nullable=True),
|
||||
'ca_cert_uuid': fields.StringField(nullable=True),
|
||||
'magnum_cert_uuid': fields.StringField(nullable=True),
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -58,6 +58,8 @@ class TestBayConductorWithK8s(base.TestCase):
|
|||
'master_count': 1,
|
||||
'discovery_url': 'https://discovery.etcd.io/test',
|
||||
'master_addresses': ['172.17.2.18'],
|
||||
'ca_cert_uuid': 'xx-xx-xx-xx',
|
||||
'magnum_cert_uuid': 'xx-xx-xx-xx',
|
||||
}
|
||||
|
||||
@patch('magnum.objects.BayModel.get_by_uuid')
|
||||
|
|
|
@ -73,6 +73,8 @@ def get_test_bay(**kw):
|
|||
'uuid': kw.get('uuid', '5d12f6fd-a196-4bf0-ae4c-1f639a523a52'),
|
||||
'name': kw.get('name', 'bay1'),
|
||||
'discovery_url': kw.get('discovery_url', None),
|
||||
'ca_cert_uuid': kw.get('ca_cert_uuid', None),
|
||||
'magnum_cert_uuid': kw.get('magnum_cert_uuid', None),
|
||||
'project_id': kw.get('project_id', 'fake_project'),
|
||||
'user_id': kw.get('user_id', 'fake_user'),
|
||||
'baymodel_id': kw.get('baymodel_id',
|
||||
|
|
Loading…
Reference in New Issue