Add 'data' fields to cluster and node

This commit is contained in:
tengqm 2014-12-18 15:08:43 +08:00
parent 3835c3e364
commit e3caa76fbc
4 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,7 @@ def upgrade(migrate_engine):
sqlalchemy.Column('status', sqlalchemy.String(255)),
sqlalchemy.Column('status_reason', sqlalchemy.String(255)),
sqlalchemy.Column('tags', types.Json),
sqlalchemy.Column('data', types.Json),
mysql_engine='InnoDB',
mysql_charset='utf8'
)
@ -76,6 +77,7 @@ def upgrade(migrate_engine):
sqlalchemy.Column('status', sqlalchemy.String(255)),
sqlalchemy.Column('status_reason', sqlalchemy.String(255)),
sqlalchemy.Column('tags', types.Json),
sqlalchemy.Column('data', types.Json),
mysql_engine='InnoDB',
mysql_charset='utf8'
)

View File

@ -103,6 +103,7 @@ class Cluster(BASE, SenlinBase, SoftDelete):
status = sqlalchemy.Column(sqlalchemy.String(255))
status_reason = sqlalchemy.Column(sqlalchemy.String(255))
tags = sqlalchemy.Column(types.Json)
data = sqlalchemy.Column(types.Json)
class Node(BASE, SenlinBase):
@ -128,6 +129,7 @@ class Node(BASE, SenlinBase):
status = sqlalchemy.Column(sqlalchemy.String(255))
status_reason = sqlalchemy.Column(sqlalchemy.String(255))
tags = sqlalchemy.Column(types.Json)
data = sqlalchemy.Column(types.Json)
class ClusterLock(BASE, SenlinBase):

View File

@ -56,6 +56,7 @@ class Cluster(object):
self.status = ''
self.status_reason = ''
self.data = {}
self.tags = {}
# persist object into database very early because:

View File

@ -48,6 +48,7 @@ class Node(object):
self.status = self.ACTIVE
self.status_reason = 'Initialized'
self.data = {}
self.tags = {}
# TODO: store this to database