Commit 772349c2 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 0059048e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line


#!/bin/bash
# Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
+0 −3
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ import json
from flask import (
    current_app, render_template, Blueprint, flash, session, redirect, url_for
)
import logging
from common.DeviceTypes import DeviceTypeEnum
from common.proto.context_pb2 import (
    ConfigActionEnum, Device, DeviceDriverEnum, DeviceId, DeviceList,
@@ -34,9 +33,7 @@ device_client = DeviceClient()

@device.get('/')
def home():
    logging.info(f'session device {session}')
    if 'context_uuid' not in session or 'topology_uuid' not in session:
        
        flash("Please select a context!", "warning")
        return redirect(url_for("main.home"))

+5 −21
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import base64, json, logging , os  #, re
import base64, json, logging #, re
from flask import jsonify, redirect, render_template, Blueprint, flash, session, url_for, request
from common.proto.context_pb2 import ContextList, Empty, TopologyId, TopologyList
from common.tools.descriptor.Loader import DescriptorLoader, compose_notifications
@@ -53,8 +53,6 @@ def process_descriptors(descriptors):

@main.route('/', methods=['GET', 'POST'])
def home():
    
    LOGGER.info(f'session  {session}')
    context_client.connect()
    device_client.connect()
    context_topology_form = ContextTopologyForm()
@@ -76,7 +74,6 @@ def home():
            context_topology_form.context_topology.choices.append(context_topology_entry)

    if context_topology_form.validate_on_submit():
       
        context_topology_uuid = context_topology_form.context_topology.data
        if len(context_topology_uuid) > 0:
            b64_values = context_topology_uuid.split(',')
@@ -187,20 +184,7 @@ def about():
def debug():
    return render_template('main/debug.html')

# @main.get('/resetsession')
# def reset_session():
#     session.clear()
#     return redirect(url_for("main.home"))


@main.get('/add_all')
def add_all():
    current_dir = os.path.dirname(os.path.abspath(__file__))
    file_path = "/home/webui/teraflow/webui/test/all.json"
    with open(file_path, 'r') as file:
        data = json.load(file)
        defescriptor_loader = DescriptorLoader(data, num_workers=10)
        results = defescriptor_loader.process()
    
@main.get('/resetsession')
def reset_session():
    session.clear()
    return redirect(url_for("main.home"))
+1 −1

File changed.

Contains only whitespace changes.