Commit 5db023b9 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 91d834f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -352,7 +352,7 @@ class GetTopology(Resource):


            rsa = RSA(node_dict, links_dict)
            rsa = RSA(node_dict, links_dict)
            if debug:
            if debug:
                print(rsa.init_link_slots2(testing))
                print(rsa.init_link_slots2())
            return "ok", 200
            return "ok", 200
        except Exception as e:
        except Exception as e:
            print(f"err {e}")
            print(f"err {e}")
+2 −2
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ class RSA():
        self.s_slot_number = 0
        self.s_slot_number = 0
        self.optical_bands = {}
        self.optical_bands = {}


    def init_link_slots(self, testing):
    def init_link_slots(self):
        if full_links:
        if full_links:
            for l in self.links_dict["optical_links"]:
            for l in self.links_dict["optical_links"]:
                for fib in l["optical_link"]["details"]["fibers"]:
                for fib in l["optical_link"]["details"]["fibers"]:
@@ -58,7 +58,7 @@ class RSA():
            break
            break
        return "{},{},{}".format(self.c_slot_number, self.l_slot_number, self.s_slot_number)
        return "{},{},{}".format(self.c_slot_number, self.l_slot_number, self.s_slot_number)


    def init_link_slots2(self, testing):
    def init_link_slots2(self):
        if full_links:
        if full_links:
            for l in self.links_dict["optical_links"]:
            for l in self.links_dict["optical_links"]:
                fib = l["optical_details"]
                fib = l["optical_details"]
+0 −67
Original line number Original line Diff line number Diff line
{
    "R1":{
        "id":0,
        "ip":"10.30.2.207",
        "port":"50001",
        "type":"OC-ROADM",
        "driver": "OpticalOC"
    },

    "R2":{
        "id":1,
        "ip":"10.30.2.208",
        "port":"50001",
        "type":"OC-ROADM",
        "driver": "OpticalOC"
    },

    "R3":{
        "id":2,
        "ip":"10.30.2.209",
        "port":"50001",
        "type":"OC-ROADM",
        "driver": "OpticalOC"
    },
    "T1.1":{
        "id":3,
        "ip":"10.30.2.210",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    },
    "T1.2":{
        "id":3,
        "ip":"10.30.2.210",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    },
    "T1.3":{
        "id":3,
        "ip":"10.30.2.210",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    },
    "T2.1":{
        "id":4,
        "ip":"10.30.2.211",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    },
    "T2.2":{
        "id":4,
        "ip":"10.30.2.211",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    },
    "T2.3":{
        "id":4,
        "ip":"10.30.2.211",
        "port":"50001",
        "type":"OC-TP",
        "driver": "OpticalOC"
    }
}
+0 −486
Original line number Original line Diff line number Diff line
{
  "R1-R2": {
    "length": 80,
    "source": "d1",
    "target": "d1",
    "fibers": {
      "d1-1": {
        "length": 80,
        "src_port": "3",
        "dst_port": "14",
        "local_peer_port": "13",
        "remote_peer_port": "4",
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  },
  "R2-R1": {
    "length": 80,
    "source": "d1",
    "target": "d1",
    "fibers": {
      "d1-1": {
        "length": 80,
        "src_port": "4",
        "dst_port": "13",
        "local_peer_port": "14",
        "remote_peer_port": "3",
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  },
  "T1-R1": {
    "length": 0,
    "source": "muxT",
    "target": "srgR",
    "fibers": {
      "M1": {
        "length": 0,
        "src_port": "1",
        "dst_port": "12",
        "local_peer_port": "1",
        "remote_peer_port": "2",
        "used": false,
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  },
  "R1-T1": {
    "length": 0,
    "source": "srgT",
    "target": "muxR",
    "fibers": {
      "S1": {
        "length": 0,
        "src_port": "2",
        "dst_port": "1",
        "local_peer_port": "12",
        "remote_peer_port": "1",
        "used": false,
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  },
  "T2-R2": {
    "length": 0,
    "source": "muxT",
    "target": "srgR",
    "fibers": {
      "M1": {
        "length": 0,
        "src_port": "6",
        "dst_port": "15",
        "local_peer_port": "6",
        "remote_peer_port": "5",
        "used": false,
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  },
  "R2-T2": {
    "length": 0,
    "source": "srgT",
    "target": "muxR",
    "fibers": {
      "S1": {
        "length": 0,
        "src_port": "5",
        "dst_port": "6",
        "local_peer_port": "15",
        "remote_peer_port": "6",
        "used": false,
        "c_slots": [
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20
        ],
        "l_slots": [
          101,
          102,
          103,
          104,
          105,
          106,
          107,
          108,
          109,
          110,
          111,
          112,
          113,
          114,
          115,
          116,
          117,
          118,
          119,
          120
        ],
        "s_slots": [
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          509,
          510,
          511,
          512,
          513,
          514,
          515,
          516,
          517,
          518,
          519,
          520
        ]
      }
    }
  }
}
+0 −1836

File deleted.

Preview size limit exceeded, changes collapsed.

Loading