Resolved issue with reports from orchestration engine
This commit is contained in:
parent
df9834018c
commit
f0b954db21
|
@ -42,8 +42,8 @@ class TaskResultHandlerService(service.Service):
|
|||
bind(conf.results_exchange, conf.results_queue)
|
||||
bind(conf.reports_exchange, conf.reports_queue)
|
||||
|
||||
ch.basic_consume(conf.results_exchange, callback=handle_result)
|
||||
ch.basic_consume(conf.reports_exchange, callback=handle_report)
|
||||
ch.basic_consume(conf.results_exchange, callback=handle_result, no_ack=True)
|
||||
ch.basic_consume(conf.reports_exchange, callback=handle_report, no_ack=True)
|
||||
while ch.callbacks:
|
||||
ch.wait()
|
||||
|
||||
|
@ -51,8 +51,12 @@ class TaskResultHandlerService(service.Service):
|
|||
def handle_report(msg):
|
||||
log.debug(_('Got report message from orchestration engine:\n{0}'.format(msg.body)))
|
||||
|
||||
params = anyjson.deserialize(msg.body)
|
||||
params['entity_id'] = params['id']
|
||||
del params['id']
|
||||
|
||||
status = Status()
|
||||
status.update(anyjson.deserialize(msg.body))
|
||||
status.update(params)
|
||||
|
||||
session = get_session()
|
||||
#connect with session
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
from sqlalchemy.schema import MetaData, Table, Column
|
||||
from sqlalchemy.types import String
|
||||
|
||||
meta = MetaData()
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
meta.bind = migrate_engine
|
||||
status = Table('status', meta, autoload=True)
|
||||
entity_id = Column('entity_id', String(32), nullable=True)
|
||||
entity_id.create(status)
|
||||
|
||||
|
||||
def downgrade(migrate_engine):
|
||||
meta.bind = migrate_engine
|
||||
status = Table('status', meta, autoload=True)
|
||||
status.c.entity_id.drop()
|
|
@ -132,7 +132,8 @@ class Session(BASE, ModelBase):
|
|||
class Status(BASE, ModelBase):
|
||||
__tablename__ = 'status'
|
||||
|
||||
id = Column(String(32), primary_key=True)
|
||||
id = Column(String(32), primary_key=True, default=uuidutils.generate_uuid)
|
||||
entity_id = Column(String(32), nullable=False)
|
||||
entity = Column(String(10), nullable=False)
|
||||
environment_id = Column(String(32), ForeignKey('environment.id'))
|
||||
session_id = Column(String(32), ForeignKey('session.id'))
|
||||
|
|
Loading…
Reference in New Issue