Skip to content
Snippets Groups Projects
Commit 12a16398 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- Fixed set/update condition for components
- Removed unneeded log messages
parent 57b355eb
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!216Resolve "Automate end-to-end tests and integrate them in CI/CD pipeline"
......@@ -203,15 +203,15 @@ def device_set(db_engine : Engine, messagebroker : MessageBroker, request : Devi
stmt = stmt.returning(TopologyDeviceModel.topology_uuid)
topology_uuids = session.execute(stmt).fetchall()
LOGGER.warning('RAW topology_uuids={:s}'.format(str(topology_uuids)))
#LOGGER.warning('RAW topology_uuids={:s}'.format(str(topology_uuids)))
if len(topology_uuids) > 0:
topology_uuids = [topology_uuid[0] for topology_uuid in topology_uuids]
LOGGER.warning('NEW topology_uuids={:s}'.format(str(topology_uuids)))
#LOGGER.warning('NEW topology_uuids={:s}'.format(str(topology_uuids)))
query = session.query(TopologyModel)
query = query.filter(TopologyModel.topology_uuid.in_(topology_uuids))
device_topologies : List[TopologyModel] = query.all()
device_topology_ids = [obj.dump_id() for obj in device_topologies]
LOGGER.warning('device_topology_ids={:s}'.format(str(device_topology_ids)))
#LOGGER.warning('device_topology_ids={:s}'.format(str(device_topology_ids)))
updated_components = False
......@@ -233,7 +233,7 @@ def device_set(db_engine : Engine, messagebroker : MessageBroker, request : Devi
changed_config_rules = upsert_config_rules(session, config_rules, device_uuid=device_uuid)
return updated or updated_endpoints or changed_config_rules, device_topology_ids
return updated or updated_endpoints or updated_components or changed_config_rules, device_topology_ids
updated, device_topology_ids = run_transaction(sessionmaker(bind=db_engine), callback)
device_id = json_device_id(device_uuid)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment