ofs | hex dump | ascii |
---|
0000 | 76 70 70 5f 74 6f 70 6f 6c 6f 67 79 2e 70 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | vpp_topology.py................. |
0020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0060 | 00 00 00 00 30 30 30 36 34 34 20 00 30 30 30 37 36 35 20 00 30 30 30 30 32 34 20 00 30 30 30 30 | ....000644..000765..000024..0000 |
0080 | 30 30 32 30 31 33 33 20 31 32 37 33 31 37 36 34 30 32 33 20 30 31 34 32 36 32 00 20 30 00 00 00 | 0020133.12731764023.014262..0... |
00a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0100 | 00 75 73 74 61 72 00 30 30 77 64 65 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .ustar.00wdec................... |
0120 | 00 00 00 00 00 00 00 00 00 73 74 61 66 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .........staff.................. |
0140 | 00 00 00 00 00 00 00 00 00 30 30 30 30 30 30 20 00 30 30 30 30 30 30 20 00 00 00 00 00 00 00 00 | .........000000..000000......... |
0160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0200 | 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 31 36 20 4f 70 65 6e 53 74 61 63 6b 20 46 | #.Copyright.(c).2016.OpenStack.F |
0220 | 6f 75 6e 64 61 74 69 6f 6e 0a 23 20 41 6c 6c 20 52 69 67 68 74 73 20 52 65 73 65 72 76 65 64 2e | oundation.#.All.Rights.Reserved. |
0240 | 0a 23 0a 23 20 20 20 20 4c 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 74 68 65 20 41 70 61 63 68 | .#.#....Licensed.under.the.Apach |
0260 | 65 20 4c 69 63 65 6e 73 65 2c 20 56 65 72 73 69 6f 6e 20 32 2e 30 20 28 74 68 65 20 22 4c 69 63 | e.License,.Version.2.0.(the."Lic |
0280 | 65 6e 73 65 22 29 3b 20 79 6f 75 20 6d 61 79 0a 23 20 20 20 20 6e 6f 74 20 75 73 65 20 74 68 69 | ense");.you.may.#....not.use.thi |
02a0 | 73 20 66 69 6c 65 20 65 78 63 65 70 74 20 69 6e 20 63 6f 6d 70 6c 69 61 6e 63 65 20 77 69 74 68 | s.file.except.in.compliance.with |
02c0 | 20 74 68 65 20 4c 69 63 65 6e 73 65 2e 20 59 6f 75 20 6d 61 79 20 6f 62 74 61 69 6e 0a 23 20 20 | .the.License..You.may.obtain.#.. |
02e0 | 20 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 20 61 74 0a 23 0a 23 20 20 | ..a.copy.of.the.License.at.#.#.. |
0300 | 20 20 20 20 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 61 70 61 63 68 65 2e 6f 72 67 2f 6c 69 63 | .......http://www.apache.org/lic |
0320 | 65 6e 73 65 73 2f 4c 49 43 45 4e 53 45 2d 32 2e 30 0a 23 0a 23 20 20 20 20 55 6e 6c 65 73 73 20 | enses/LICENSE-2.0.#.#....Unless. |
0340 | 72 65 71 75 69 72 65 64 20 62 79 20 61 70 70 6c 69 63 61 62 6c 65 20 6c 61 77 20 6f 72 20 61 67 | required.by.applicable.law.or.ag |
0360 | 72 65 65 64 20 74 6f 20 69 6e 20 77 72 69 74 69 6e 67 2c 20 73 6f 66 74 77 61 72 65 0a 23 20 20 | reed.to.in.writing,.software.#.. |
0380 | 20 20 64 69 73 74 72 69 62 75 74 65 64 20 75 6e 64 65 72 20 74 68 65 20 4c 69 63 65 6e 73 65 20 | ..distributed.under.the.License. |
03a0 | 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 6f 6e 20 61 6e 20 22 41 53 20 49 53 22 20 42 41 53 | is.distributed.on.an."AS.IS".BAS |
03c0 | 49 53 2c 20 57 49 54 48 4f 55 54 0a 23 20 20 20 20 57 41 52 52 41 4e 54 49 45 53 20 4f 52 20 43 | IS,.WITHOUT.#....WARRANTIES.OR.C |
03e0 | 4f 4e 44 49 54 49 4f 4e 53 20 4f 46 20 41 4e 59 20 4b 49 4e 44 2c 20 65 69 74 68 65 72 20 65 78 | ONDITIONS.OF.ANY.KIND,.either.ex |
0400 | 70 72 65 73 73 20 6f 72 20 69 6d 70 6c 69 65 64 2e 20 53 65 65 20 74 68 65 0a 23 20 20 20 20 4c | press.or.implied..See.the.#....L |
0420 | 69 63 65 6e 73 65 20 66 6f 72 20 74 68 65 20 73 70 65 63 69 66 69 63 20 6c 61 6e 67 75 61 67 65 | icense.for.the.specific.language |
0440 | 20 67 6f 76 65 72 6e 69 6e 67 20 70 65 72 6d 69 73 73 69 6f 6e 73 20 61 6e 64 20 6c 69 6d 69 74 | .governing.permissions.and.limit |
0460 | 61 74 69 6f 6e 73 0a 23 20 20 20 20 75 6e 64 65 72 20 74 68 65 20 4c 69 63 65 6e 73 65 2e 0a 0a | ations.#....under.the.License... |
0480 | 0a 69 6d 70 6f 72 74 20 63 6f 6c 6c 65 63 74 69 6f 6e 73 0a 69 6d 70 6f 72 74 20 6f 73 0a 0a 66 | .import.collections.import.os..f |
04a0 | 72 6f 6d 20 6f 73 6c 6f 5f 6c 6f 67 20 69 6d 70 6f 72 74 20 6c 6f 67 0a 69 6d 70 6f 72 74 20 73 | rom.oslo_log.import.log.import.s |
04c0 | 69 78 0a 66 72 6f 6d 20 73 69 78 2e 6d 6f 76 65 73 2e 75 72 6c 6c 69 62 20 69 6d 70 6f 72 74 20 | ix.from.six.moves.urllib.import. |
04e0 | 70 61 72 73 65 0a 0a 66 72 6f 6d 20 6e 65 75 74 72 6f 6e 2e 63 6f 6d 6d 6f 6e 20 69 6d 70 6f 72 | parse..from.neutron.common.impor |
0500 | 74 20 63 6f 6e 73 74 61 6e 74 73 20 61 73 20 6e 5f 63 6f 6e 73 74 0a 66 72 6f 6d 20 6e 65 75 74 | t.constants.as.n_const.from.neut |
0520 | 72 6f 6e 2e 65 78 74 65 6e 73 69 6f 6e 73 20 69 6d 70 6f 72 74 20 70 6f 72 74 62 69 6e 64 69 6e | ron.extensions.import.portbindin |
0540 | 67 73 0a 66 72 6f 6d 20 6e 65 75 74 72 6f 6e 2e 70 6c 75 67 69 6e 73 2e 63 6f 6d 6d 6f 6e 20 69 | gs.from.neutron.plugins.common.i |
0560 | 6d 70 6f 72 74 20 63 6f 6e 73 74 61 6e 74 73 0a 66 72 6f 6d 20 6e 65 75 74 72 6f 6e 2e 70 6c 75 | mport.constants.from.neutron.plu |
0580 | 67 69 6e 73 2e 6d 6c 32 20 69 6d 70 6f 72 74 20 64 72 69 76 65 72 5f 61 70 69 0a 0a 66 72 6f 6d | gins.ml2.import.driver_api..from |
05a0 | 20 6e 65 74 77 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 6d 6c 32 20 69 6d 70 6f 72 74 20 6e 65 74 77 6f | .networking_odl.ml2.import.netwo |
05c0 | 72 6b 5f 74 6f 70 6f 6c 6f 67 79 0a 0a 0a 4c 4f 47 20 3d 20 6c 6f 67 2e 67 65 74 4c 6f 67 67 65 | rk_topology...LOG.=.log.getLogge |
05e0 | 72 28 5f 5f 6e 61 6d 65 5f 5f 29 0a 48 43 5f 56 50 50 5f 43 41 50 41 42 49 4c 49 54 59 20 3d 20 | r(__name__).HC_VPP_CAPABILITY.=. |
0600 | 27 68 6f 6e 65 79 63 6f 6d 62 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e 73 3a 79 61 6e 67 3a 76 70 | 'honeycomb:params:xml:ns:yang:vp |
0620 | 70 3a 64 61 74 61 3a 27 0a 0a 63 6c 61 73 73 20 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f | p:data:'..class.VppNetworkTopolo |
0640 | 67 79 50 61 72 73 65 72 28 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 2e 4e 65 74 77 6f 72 | gyParser(network_topology.Networ |
0660 | 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 29 3a 0a 0a 20 20 20 20 64 65 66 20 6e 65 77 5f 65 | kTopologyParser):......def.new_e |
0680 | 6c 65 6d 65 6e 74 28 73 65 6c 66 2c 20 64 65 76 6e 61 6d 65 29 3a 0a 20 20 20 20 20 20 20 20 72 | lement(self,.devname):.........r |
06a0 | 65 74 75 72 6e 20 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 28 | eturn.VppNetworkTopologyElement( |
06c0 | 64 65 76 6e 61 6d 65 3d 64 65 76 6e 61 6d 65 29 0a 0a 20 20 20 20 64 65 66 20 70 61 72 73 65 5f | devname=devname)......def.parse_ |
06e0 | 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 28 73 65 6c 66 2c 20 6e 65 74 77 6f 72 6b 5f 74 | network_topology(self,.network_t |
0700 | 6f 70 6f 6c 6f 67 69 65 73 29 3a 0a 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 62 75 67 28 22 50 | opologies):.........LOG.debug("P |
0720 | 61 72 73 69 6e 67 20 54 6f 70 6f 6c 6f 67 79 20 75 73 69 6e 67 20 56 50 50 20 54 6f 70 6f 6c 6f | arsing.Topology.using.VPP.Topolo |
0740 | 67 79 20 50 61 72 73 65 72 22 29 0a 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 73 5f 62 79 5f | gy.Parser").........elements_by_ |
0760 | 6e 61 6d 65 20 3d 20 63 6f 6c 6c 65 63 74 69 6f 6e 73 2e 4f 72 64 65 72 65 64 44 69 63 74 28 29 | name.=.collections.OrderedDict() |
0780 | 0a 20 20 20 20 20 20 20 20 66 6f 72 20 74 6f 70 6f 6c 6f 67 79 20 69 6e 20 6e 65 74 77 6f 72 6b | .........for.topology.in.network |
07a0 | 5f 74 6f 70 6f 6c 6f 67 69 65 73 5b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 6e 65 | _topologies[.................'ne |
07c0 | 74 77 6f 72 6b 2d 74 6f 70 6f 6c 6f 67 79 27 5d 5b 27 74 6f 70 6f 6c 6f 67 79 27 5d 3a 0a 20 20 | twork-topology']['topology']:... |
07e0 | 20 20 20 20 20 20 20 20 20 20 69 66 20 74 6f 70 6f 6c 6f 67 79 5b 27 74 6f 70 6f 6c 6f 67 79 2d | ..........if.topology['topology- |
0800 | 69 64 27 5d 2e 73 74 61 72 74 73 77 69 74 68 28 27 74 6f 70 6f 6c 6f 67 79 2d 6e 65 74 63 6f 6e | id'].startswith('topology-netcon |
0820 | 66 27 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 6e 6f 64 65 20 69 6e | f'):.................for.node.in |
0840 | 20 74 6f 70 6f 6c 6f 67 79 5b 27 6e 6f 64 65 27 5d 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .topology['node']:.............. |
0860 | 20 20 20 20 20 20 20 23 20 65 78 70 65 63 74 65 64 20 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 | .......#.expected.:............. |
0880 | 20 20 20 20 20 20 20 20 23 20 22 6e 6f 64 65 2d 69 64 22 3a 20 22 6e 61 6d 65 22 2c 0a 20 20 20 | ........#."node-id":."name",.... |
08a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 22 6e 65 74 63 6f 6e 66 2d 6e 6f 64 65 | .................#."netconf-node |
08c0 | 2d 74 6f 70 6f 6c 6f 67 79 3a 68 6f 73 74 22 3a 20 22 31 37 32 2e 32 31 2e 31 37 34 2e 34 31 22 | -topology:host":."172.21.174.41" |
08e0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 22 6e 65 74 63 6f 6e 66 2d | .....................#."netconf- |
0900 | 6e 6f 64 65 2d 74 6f 70 6f 6c 6f 67 79 3a 61 76 61 69 6c 61 62 6c 65 2d 63 61 70 61 62 69 6c 69 | node-topology:available-capabili |
0920 | 74 69 65 73 22 3a 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 | ties":.{.....................#.. |
0940 | 20 20 20 20 20 22 61 76 61 69 6c 61 62 6c 65 2d 63 61 70 61 62 69 6c 69 74 79 22 20 3a 20 63 6f | ....."available-capability".:.co |
0960 | 6e 74 61 69 6e 73 20 74 68 65 20 76 33 70 6f 20 6d 6f 64 65 6c 0a 20 20 20 20 20 20 20 20 20 20 | ntains.the.v3po.model........... |
0980 | 20 20 20 20 20 20 20 20 20 20 6e 6f 64 65 5f 6e 61 6d 65 20 3d 20 6e 6f 64 65 5b 27 6e 6f 64 65 | ..........node_name.=.node['node |
09a0 | 2d 69 64 27 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 | -id'].....................LOG.de |
09c0 | 62 75 67 28 22 45 78 61 6d 69 6e 69 6e 67 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 66 6f 72 20 | bug("Examining.capabilities.for. |
09e0 | 6e 6f 64 65 3a 20 25 73 5c 6e 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | node:.%s\n",.................... |
0a00 | 20 20 20 20 20 20 20 20 20 20 20 6e 6f 64 65 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 20 20 | ...........node_name)........... |
0a20 | 20 20 20 20 20 20 20 20 20 20 74 72 79 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ..........try:.................. |
0a40 | 20 20 20 20 20 20 20 63 61 70 61 62 69 6c 69 74 69 65 73 20 3d 20 6e 6f 64 65 5b 0a 20 20 20 20 | .......capabilities.=.node[..... |
0a60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 6e 65 74 63 6f 6e 66 2d 6e 6f 64 | ....................'netconf-nod |
0a80 | 65 2d 74 6f 70 6f 6c 6f 67 79 3a 61 76 61 69 6c 61 62 6c 65 2d 63 61 70 61 62 69 6c 69 74 69 65 | e-topology:available-capabilitie |
0aa0 | 73 27 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e | s'].........................LOG. |
0ac0 | 64 65 62 75 67 28 22 4e 6f 64 65 27 73 20 63 61 70 61 62 69 6c 69 74 69 65 73 3a 20 25 73 5c 6e | debug("Node's.capabilities:.%s\n |
0ae0 | 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ",.............................. |
0b00 | 20 20 20 20 20 63 61 70 61 62 69 6c 69 74 69 65 73 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .....capabilities).............. |
0b20 | 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 69 74 65 6d 20 69 6e 20 63 61 70 61 62 69 6c 69 74 | ...........for.item.in.capabilit |
0b40 | 69 65 73 5b 27 61 76 61 69 6c 61 62 6c 65 2d 63 61 70 61 62 69 6c 69 74 79 27 5d 3a 0a 20 20 20 | ies['available-capability']:.... |
0b60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 48 43 5f 56 | .........................if.HC_V |
0b80 | 50 50 5f 43 41 50 41 42 49 4c 49 54 59 20 69 6e 20 69 74 65 6d 3a 0a 20 20 20 20 20 20 20 20 20 | PP_CAPABILITY.in.item:.......... |
0ba0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 62 75 67 | .......................LOG.debug |
0bc0 | 28 22 46 6f 75 6e 64 20 56 50 50 20 6d 61 74 63 68 69 6e 67 20 63 61 70 61 62 69 6c 69 74 79 20 | ("Found.VPP.matching.capability. |
0be0 | 66 6f 72 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | for."........................... |
0c00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 6e 6f 64 65 3a 20 25 73 5c 6e 22 2c 20 6e 6f | ................"node:.%s\n",.no |
0c20 | 64 65 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | de_name)........................ |
0c40 | 20 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 20 3d 20 65 6c 65 6d 65 6e 74 73 5f 62 79 5f 6e | .........element.=.elements_by_n |
0c60 | 61 6d 65 2e 67 65 74 28 6e 6f 64 65 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | ame.get(node_name).............. |
0c80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 65 6c 65 6d 65 6e 74 20 69 73 | ...................if.element.is |
0ca0 | 20 4e 6f 6e 65 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .None:.......................... |
0cc0 | 20 20 20 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 73 5f 62 79 5f 6e 61 6d 65 5b 6e 6f 64 65 | ...........elements_by_name[node |
0ce0 | 5f 6e 61 6d 65 5d 20 3d 20 65 6c 65 6d 65 6e 74 20 3d 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 | _name].=.element.=\............. |
0d00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 6c 66 | ............................self |
0d20 | 2e 6e 65 77 5f 65 6c 65 6d 65 6e 74 28 6e 6f 64 65 5f 6e 61 6d 65 29 0a 0a 20 20 20 20 20 20 20 | .new_element(node_name)......... |
0d40 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 6c 66 2e 5c 0a | .........................self.\. |
0d60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
0d80 | 20 20 20 20 5f 75 70 64 61 74 65 5f 65 6c 65 6d 65 6e 74 5f 66 72 6f 6d 5f 6a 73 6f 6e 5f 6e 65 | ...._update_element_from_json_ne |
0da0 | 74 63 6f 6e 66 5f 74 6f 70 6f 6c 6f 67 79 5f 6e 6f 64 65 28 0a 20 20 20 20 20 20 20 20 20 20 20 | tconf_topology_node(............ |
0dc0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 6f 64 65 2c 20 65 | .........................node,.e |
0de0 | 6c 65 6d 65 6e 74 2c 20 6e 6f 64 65 5f 6e 61 6d 65 2c 20 63 61 70 61 62 69 6c 69 74 69 65 73 29 | lement,.node_name,.capabilities) |
0e00 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 4b 65 79 45 | .....................except.KeyE |
0e20 | 72 72 6f 72 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f | rror:.........................LO |
0e40 | 47 2e 64 65 62 75 67 28 22 4e 6f 20 6e 65 74 63 6f 6e 66 20 61 76 61 69 6c 61 62 6c 65 20 63 61 | G.debug("No.netconf.available.ca |
0e60 | 70 61 62 69 6c 69 74 69 65 73 20 66 6f 75 6e 64 20 66 6f 72 22 0a 20 20 20 20 20 20 20 20 20 20 | pabilities.found.for"........... |
0e80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 3a 20 25 73 5c 6e 22 | ........................":.%s\n" |
0ea0 | 2c 20 6e 6f 64 65 5f 6e 61 6d 65 29 0a 0a 20 20 20 20 20 20 20 20 23 20 43 61 6e 20 74 68 65 72 | ,.node_name)..........#.Can.ther |
0ec0 | 65 20 63 61 6e 20 62 65 20 6d 6f 72 65 20 56 50 50 20 69 6e 73 74 61 6e 63 65 73 20 63 6f 6e 6e | e.can.be.more.VPP.instances.conn |
0ee0 | 65 63 74 65 64 20 62 65 73 69 64 65 20 74 68 65 20 73 61 6d 65 20 49 50 0a 20 20 20 20 20 20 20 | ected.beside.the.same.IP........ |
0f00 | 20 23 20 61 64 64 72 65 73 73 3f 0a 20 20 20 20 20 20 20 20 23 20 43 61 63 68 65 20 77 69 6c 6c | .#.address?.........#.Cache.will |
0f20 | 20 79 69 65 6c 64 20 6d 6f 72 65 20 69 6e 73 74 61 63 65 73 20 66 6f 72 20 74 68 65 20 73 61 6d | .yield.more.instaces.for.the.sam |
0f40 | 65 20 6b 65 79 0a 20 20 20 20 20 20 20 20 66 6f 72 20 5f 5f 2c 20 65 6c 65 6d 65 6e 74 20 69 6e | e.key.........for.__,.element.in |
0f60 | 20 73 69 78 2e 69 74 65 72 69 74 65 6d 73 28 65 6c 65 6d 65 6e 74 73 5f 62 79 5f 6e 61 6d 65 29 | .six.iteritems(elements_by_name) |
0f80 | 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 65 6c 65 6d 65 6e 74 0a 0a 20 20 20 | :.............yield.element..... |
0fa0 | 20 64 65 66 20 5f 75 70 64 61 74 65 5f 65 6c 65 6d 65 6e 74 5f 66 72 6f 6d 5f 6a 73 6f 6e 5f 6e | .def._update_element_from_json_n |
0fc0 | 65 74 63 6f 6e 66 5f 74 6f 70 6f 6c 6f 67 79 5f 6e 6f 64 65 28 0a 20 20 20 20 20 20 20 20 20 20 | etconf_topology_node(........... |
0fe0 | 20 20 73 65 6c 66 2c 20 6e 6f 64 65 2c 20 65 6c 65 6d 65 6e 74 2c 20 6e 6f 64 65 5f 6e 61 6d 65 | ..self,.node,.element,.node_name |
1000 | 2c 20 63 61 70 61 62 69 6c 69 74 69 65 73 3d 4e 6f 6e 65 29 3a 0a 0a 20 20 20 20 20 20 20 20 23 | ,.capabilities=None):..........# |
1020 | 20 66 65 74 63 68 20 72 65 6d 6f 74 65 20 49 50 20 61 64 64 72 65 73 73 0a 20 20 20 20 20 20 20 | .fetch.remote.IP.address........ |
1040 | 20 65 6c 65 6d 65 6e 74 2e 72 65 6d 6f 74 65 5f 69 70 20 3d 20 6e 6f 64 65 5b 22 6e 65 74 63 6f | .element.remote_ip.=.node["netco |
1060 | 6e 66 2d 6e 6f 64 65 2d 74 6f 70 6f 6c 6f 67 79 3a 68 6f 73 74 22 5d 0a 20 20 20 20 20 20 20 20 | nf-node-topology:host"]......... |
1080 | 23 20 41 73 73 75 6d 65 20 48 6f 6e 65 79 63 6f 6d 62 20 73 75 70 70 6f 72 74 73 20 76 68 6f 73 | #.Assume.Honeycomb.supports.vhos |
10a0 | 74 5f 75 73 65 72 3f 0a 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 2e 73 75 70 70 6f 72 74 5f | t_user?.........element.support_ |
10c0 | 76 68 6f 73 74 5f 75 73 65 72 20 3d 20 54 72 75 65 0a 0a 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 | vhost_user.=.True..........LOG.d |
10e0 | 65 62 75 67 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 27 54 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d | ebug(.............'Topology.elem |
1100 | 65 6e 74 20 75 70 64 61 74 65 64 3a 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 27 20 2d 20 | ent.updated:\n'.............'.-. |
1120 | 56 50 50 20 6e 6f 64 65 20 6e 61 6d 65 3a 20 25 28 6e 6f 64 65 5f 6e 61 6d 65 29 72 5c 6e 27 0a | VPP.node.name:.%(node_name)r\n'. |
1140 | 20 20 20 20 20 20 20 20 20 20 20 20 27 20 2d 20 72 65 6d 6f 74 65 5f 69 70 3a 20 25 28 72 65 6d | ............'.-.remote_ip:.%(rem |
1160 | 6f 74 65 5f 69 70 29 72 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 27 20 2d 20 73 75 70 70 | ote_ip)r\n'.............'.-.supp |
1180 | 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 3a 20 25 28 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f | ort_vhost_user:.%(support_vhost_ |
11a0 | 75 73 65 72 29 72 27 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 6e 6f 64 65 5f 6e 61 6d 65 | user)r',.............{'node_name |
11c0 | 27 3a 20 6e 6f 64 65 5f 6e 61 6d 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 27 72 65 6d 6f | ':.node_name,..............'remo |
11e0 | 74 65 5f 69 70 27 3a 20 65 6c 65 6d 65 6e 74 2e 72 65 6d 6f 74 65 5f 69 70 2c 0a 20 20 20 20 20 | te_ip':.element.remote_ip,...... |
1200 | 20 20 20 20 20 20 20 20 27 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 27 3a 20 65 6c | ........'support_vhost_user':.el |
1220 | 65 6d 65 6e 74 2e 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 7d 29 0a 0a 0a 0a 63 6c | ement.support_vhost_user})....cl |
1240 | 61 73 73 20 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 28 6e 65 | ass.VppNetworkTopologyElement(ne |
1260 | 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 2e 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c | twork_topology.NetworkTopologyEl |
1280 | 65 6d 65 6e 74 29 3a 0a 0a 20 20 20 20 64 65 76 6e 61 6d 65 20 3d 20 4e 6f 6e 65 20 20 23 20 46 | ement):......devname.=.None..#.F |
12a0 | 69 6c 6c 65 64 20 69 6e 20 62 79 20 70 61 72 73 65 72 0a 20 20 20 20 72 65 6d 6f 74 65 5f 69 70 | illed.in.by.parser.....remote_ip |
12c0 | 20 3d 20 4e 6f 6e 65 20 20 23 20 46 69 6c 6c 65 64 20 69 6e 20 62 79 20 70 61 72 73 65 72 0a 20 | .=.None..#.Filled.in.by.parser.. |
12e0 | 20 20 20 68 61 73 5f 64 61 74 61 70 61 74 68 5f 74 79 70 65 5f 6e 65 74 64 65 76 20 3d 20 46 61 | ...has_datapath_type_netdev.=.Fa |
1300 | 6c 73 65 20 20 23 20 50 6c 61 63 65 68 6f 6c 64 65 72 20 66 6f 72 20 66 75 74 75 72 65 20 63 61 | lse..#.Placeholder.for.future.ca |
1320 | 70 61 62 69 6c 69 74 79 0a 20 20 20 20 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 20 | pability.....support_vhost_user. |
1340 | 3d 20 46 61 6c 73 65 20 20 23 20 56 50 50 20 73 75 70 70 6f 72 74 73 20 69 74 20 62 79 20 64 65 | =.False..#.VPP.supports.it.by.de |
1360 | 66 61 75 6c 74 20 61 63 74 75 61 6c 6c 79 2e 0a 0a 20 20 20 20 23 20 6c 6f 63 61 74 69 6f 6e 20 | fault.actually.......#.location. |
1380 | 66 6f 72 20 76 68 6f 73 74 75 73 65 72 20 73 6f 63 6b 65 74 73 2e 0a 20 20 20 20 23 20 54 4f 44 | for.vhostuser.sockets......#.TOD |
13a0 | 4f 20 28 77 64 65 63 29 3a 20 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 20 63 6f 6e 66 69 67 75 | O.(wdec):.This.should.be.configu |
13c0 | 72 61 62 6c 65 20 69 6e 20 74 68 65 20 4d 4c 32 20 63 6f 6e 66 69 67 2e 0a 20 20 20 20 76 68 6f | rable.in.the.ML2.config......vho |
13e0 | 73 74 75 73 65 72 5f 73 6f 63 6b 65 74 5f 64 69 72 20 3d 20 27 2f 74 6d 70 2f 27 0a 0a 20 20 20 | stuser_socket_dir.=.'/tmp/'..... |
1400 | 20 23 20 54 4f 44 4f 20 28 77 64 65 63 29 3a 20 41 6e 64 20 61 6c 73 6f 20 74 68 69 73 20 73 68 | .#.TODO.(wdec):.And.also.this.sh |
1420 | 6f 75 6c 64 20 62 65 20 63 6f 6e 66 69 67 75 72 61 62 6c 65 2e 2e 2e 0a 20 20 20 20 23 20 70 72 | ould.be.configurable........#.pr |
1440 | 65 66 69 78 20 66 6f 72 20 70 6f 72 74 0a 20 20 20 20 70 6f 72 74 5f 70 72 65 66 69 78 20 3d 20 | efix.for.port.....port_prefix.=. |
1460 | 27 73 6f 63 6b 65 74 5f 27 0a 0a 20 20 20 20 64 65 66 20 5f 5f 69 6e 69 74 5f 5f 28 73 65 6c 66 | 'socket_'......def.__init__(self |
1480 | 2c 20 2a 2a 6b 77 61 72 67 73 29 3a 0a 20 20 20 20 20 20 20 20 66 6f 72 20 6e 61 6d 65 2c 20 76 | ,.**kwargs):.........for.name,.v |
14a0 | 61 6c 75 65 20 69 6e 20 73 69 78 2e 69 74 65 72 69 74 65 6d 73 28 6b 77 61 72 67 73 29 3a 0a 20 | alue.in.six.iteritems(kwargs):.. |
14c0 | 20 20 20 20 20 20 20 20 20 20 20 73 65 74 61 74 74 72 28 73 65 6c 66 2c 20 6e 61 6d 65 2c 20 76 | ...........setattr(self,.name,.v |
14e0 | 61 6c 75 65 29 0a 0a 20 20 20 20 40 70 72 6f 70 65 72 74 79 0a 20 20 20 20 64 65 66 20 68 6f 73 | alue)......@property.....def.hos |
1500 | 74 5f 61 64 64 72 65 73 73 65 73 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 20 20 23 20 46 6f 72 | t_addresses(self):.........#.For |
1520 | 20 6e 6f 77 20 69 74 20 73 75 70 70 6f 72 74 20 6f 6e 6c 79 20 74 68 65 20 72 65 6d 6f 74 65 20 | .now.it.support.only.the.remote. |
1540 | 49 50 20 66 6f 75 6e 64 20 69 6e 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 6e 66 6f 0a 20 20 20 20 | IP.found.in.connection.info..... |
1560 | 20 20 20 20 72 65 74 75 72 6e 20 73 65 6c 66 2e 72 65 6d 6f 74 65 5f 69 70 2c 0a 0a 20 20 20 20 | ....return.self.remote_ip,...... |
1580 | 40 70 72 6f 70 65 72 74 79 0a 20 20 20 20 64 65 66 20 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 | @property.....def.valid_vif_type |
15a0 | 73 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 70 6f 72 74 62 69 6e | s(self):.........return.[portbin |
15c0 | 64 69 6e 67 73 2e 56 49 46 5f 54 59 50 45 5f 56 48 4f 53 54 5f 55 53 45 52 5d 0a 0a 20 20 20 20 | dings.VIF_TYPE_VHOST_USER]...... |
15e0 | 64 65 66 20 62 69 6e 64 5f 70 6f 72 74 28 73 65 6c 66 2c 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 | def.bind_port(self,.port_context |
1600 | 2c 20 76 69 66 5f 74 79 70 65 2c 20 76 69 66 5f 64 65 74 61 69 6c 73 29 3a 0a 0a 20 20 20 20 20 | ,.vif_type,.vif_details):....... |
1620 | 20 20 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 5f 69 64 20 3d 20 70 6f 72 74 5f 63 6f 6e 74 65 78 | ...port_context_id.=.port_contex |
1640 | 74 2e 63 75 72 72 65 6e 74 5b 27 69 64 27 5d 0a 20 20 20 20 20 20 20 20 6e 65 74 77 6f 72 6b 5f | t.current['id'].........network_ |
1660 | 63 6f 6e 74 65 78 74 5f 69 64 20 3d 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2e 6e 65 74 77 6f 72 | context_id.=.port_context.networ |
1680 | 6b 2e 63 75 72 72 65 6e 74 5b 27 69 64 27 5d 0a 0a 20 20 20 20 20 20 20 20 23 20 42 69 6e 64 20 | k.current['id']..........#.Bind. |
16a0 | 70 6f 72 74 20 74 6f 20 74 68 65 20 66 69 72 73 74 20 76 61 6c 69 64 20 73 65 67 6d 65 6e 74 0a | port.to.the.first.valid.segment. |
16c0 | 20 20 20 20 20 20 20 20 66 6f 72 20 73 65 67 6d 65 6e 74 20 69 6e 20 70 6f 72 74 5f 63 6f 6e 74 | ........for.segment.in.port_cont |
16e0 | 65 78 74 2e 73 65 67 6d 65 6e 74 73 5f 74 6f 5f 62 69 6e 64 3a 0a 20 20 20 20 20 20 20 20 20 20 | ext.segments_to_bind:........... |
1700 | 20 20 69 66 20 73 65 6c 66 2e 5f 69 73 5f 76 61 6c 69 64 5f 73 65 67 6d 65 6e 74 28 73 65 67 6d | ..if.self._is_valid_segment(segm |
1720 | 65 6e 74 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 47 75 65 73 74 20 62 65 | ent):.................#.Guest.be |
1740 | 73 74 20 56 49 46 20 74 79 70 65 20 66 6f 72 20 67 69 76 65 6e 20 68 6f 73 74 0a 20 20 20 20 20 | st.VIF.type.for.given.host...... |
1760 | 20 20 20 20 20 20 20 20 20 20 20 76 69 66 5f 64 65 74 61 69 6c 73 20 3d 20 73 65 6c 66 2e 5f 67 | ...........vif_details.=.self._g |
1780 | 65 74 5f 76 69 66 5f 64 65 74 61 69 6c 73 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | et_vif_details(................. |
17a0 | 20 20 20 20 76 69 66 5f 64 65 74 61 69 6c 73 3d 76 69 66 5f 64 65 74 61 69 6c 73 2c 20 70 6f 72 | ....vif_details=vif_details,.por |
17c0 | 74 5f 63 6f 6e 74 65 78 74 5f 69 64 3d 70 6f 72 74 5f 63 6f 6e 74 65 78 74 5f 69 64 2c 0a 20 20 | t_context_id=port_context_id,... |
17e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 69 66 5f 74 79 70 65 3d 76 69 66 5f 74 | ..................vif_type=vif_t |
1800 | 79 70 65 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 62 75 67 28 0a | ype).................LOG.debug(. |
1820 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 42 69 6e 64 20 70 6f 72 74 20 77 | ....................'Bind.port.w |
1840 | 69 74 68 20 76 61 6c 69 64 20 73 65 67 6d 65 6e 74 3a 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 | ith.valid.segment:\n'........... |
1860 | 20 20 20 20 20 20 20 20 20 20 27 5c 74 70 6f 72 74 3a 20 25 28 70 6f 72 74 29 72 5c 6e 27 0a 20 | ..........'\tport:.%(port)r\n'.. |
1880 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 5c 74 6e 65 74 77 6f 72 6b 3a 20 25 | ...................'\tnetwork:.% |
18a0 | 28 6e 65 74 77 6f 72 6b 29 72 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | (network)r\n'................... |
18c0 | 20 20 27 5c 74 73 65 67 6d 65 6e 74 3a 20 25 28 73 65 67 6d 65 6e 74 29 72 5c 6e 27 0a 20 20 20 | ..'\tsegment:.%(segment)r\n'.... |
18e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 5c 74 56 49 46 20 74 79 70 65 3a 20 25 28 | .................'\tVIF.type:.%( |
1900 | 76 69 66 5f 74 79 70 65 29 72 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | vif_type)r\n'................... |
1920 | 20 20 27 5c 74 56 49 46 20 64 65 74 61 69 6c 73 3a 20 25 28 76 69 66 5f 64 65 74 61 69 6c 73 29 | ..'\tVIF.details:.%(vif_details) |
1940 | 72 27 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 70 6f 72 74 27 3a | r',.....................{'port': |
1960 | 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 5f 69 64 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .port_context_id,............... |
1980 | 20 20 20 20 20 20 20 27 6e 65 74 77 6f 72 6b 27 3a 20 6e 65 74 77 6f 72 6b 5f 63 6f 6e 74 65 78 | .......'network':.network_contex |
19a0 | 74 5f 69 64 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 73 65 67 6d | t_id,......................'segm |
19c0 | 65 6e 74 27 3a 20 73 65 67 6d 65 6e 74 2c 20 27 76 69 66 5f 74 79 70 65 27 3a 20 76 69 66 5f 74 | ent':.segment,.'vif_type':.vif_t |
19e0 | 79 70 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 76 69 66 5f 64 | ype,......................'vif_d |
1a00 | 65 74 61 69 6c 73 27 3a 20 76 69 66 5f 64 65 74 61 69 6c 73 7d 29 0a 20 20 20 20 20 20 20 20 20 | etails':.vif_details}).......... |
1a20 | 20 20 20 20 20 20 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2e 73 65 74 5f 62 69 6e 64 69 6e 67 28 | .......port_context.set_binding( |
1a40 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 67 6d 65 6e 74 5b 64 72 69 | .....................segment[dri |
1a60 | 76 65 72 5f 61 70 69 2e 49 44 5d 2c 20 76 69 66 5f 74 79 70 65 2c 20 76 69 66 5f 64 65 74 61 69 | ver_api.ID],.vif_type,.vif_detai |
1a80 | 6c 73 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 61 74 75 73 3d 6e | ls,.....................status=n |
1aa0 | 5f 63 6f 6e 73 74 2e 50 4f 52 54 5f 53 54 41 54 55 53 5f 41 43 54 49 56 45 29 0a 20 20 20 20 20 | _const.PORT_STATUS_ACTIVE)...... |
1ac0 | 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 0a 0a 20 20 20 20 20 20 20 20 72 61 69 73 65 | ...........return..........raise |
1ae0 | 20 56 61 6c 75 65 45 72 72 6f 72 28 27 55 6e 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 61 6e 79 20 | .ValueError('Unable.to.find.any. |
1b00 | 76 61 6c 69 64 20 73 65 67 6d 65 6e 74 20 69 6e 20 67 69 76 65 6e 20 63 6f 6e 74 65 78 74 2e 27 | valid.segment.in.given.context.' |
1b20 | 29 0a 0a 20 20 20 20 64 65 66 20 74 6f 5f 64 69 63 74 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 | )......def.to_dict(self):....... |
1b40 | 20 20 64 61 74 61 20 3d 20 73 75 70 65 72 28 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 | ..data.=.super(VppNetworkTopolog |
1b60 | 79 45 6c 65 6d 65 6e 74 2c 20 73 65 6c 66 29 2e 74 6f 5f 64 69 63 74 28 29 0a 20 20 20 20 20 20 | yElement,.self).to_dict()....... |
1b80 | 20 20 64 61 74 61 2e 75 70 64 61 74 65 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 75 75 69 | ..data.update(.............{'uui |
1ba0 | 64 27 3a 20 73 65 6c 66 2e 64 65 76 6e 61 6d 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 27 | d':.self.devname,..............' |
1bc0 | 68 61 73 5f 64 61 74 61 70 61 74 68 5f 74 79 70 65 5f 6e 65 74 64 65 76 27 3a 20 73 65 6c 66 2e | has_datapath_type_netdev':.self. |
1be0 | 68 61 73 5f 64 61 74 61 70 61 74 68 5f 74 79 70 65 5f 6e 65 74 64 65 76 2c 0a 20 20 20 20 20 20 | has_datapath_type_netdev,....... |
1c00 | 20 20 20 20 20 20 20 27 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 27 3a 20 73 65 6c | .......'support_vhost_user':.sel |
1c20 | 66 2e 73 75 70 70 6f 72 74 5f 76 68 6f 73 74 5f 75 73 65 72 2c 0a 20 20 20 20 20 20 20 20 20 20 | f.support_vhost_user,........... |
1c40 | 20 20 20 27 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 27 3a 20 73 65 6c 66 2e 76 61 6c 69 64 | ...'valid_vif_types':.self.valid |
1c60 | 5f 76 69 66 5f 74 79 70 65 73 7d 29 0a 20 20 20 20 20 20 20 20 69 66 20 70 6f 72 74 62 69 6e 64 | _vif_types}).........if.portbind |
1c80 | 69 6e 67 73 2e 56 49 46 5f 54 59 50 45 5f 56 48 4f 53 54 5f 55 53 45 52 20 69 6e 20 73 65 6c 66 | ings.VIF_TYPE_VHOST_USER.in.self |
1ca0 | 2e 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 64 61 | .valid_vif_types:.............da |
1cc0 | 74 61 2e 75 70 64 61 74 65 28 7b 27 70 6f 72 74 5f 70 72 65 66 69 78 27 3a 20 73 65 6c 66 2e 70 | ta.update({'port_prefix':.self.p |
1ce0 | 6f 72 74 5f 70 72 65 66 69 78 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ort_prefix,..................... |
1d00 | 20 20 20 20 20 27 76 68 6f 73 74 75 73 65 72 5f 73 6f 63 6b 65 74 5f 64 69 72 27 3a 20 73 65 6c | .....'vhostuser_socket_dir':.sel |
1d20 | 66 2e 76 68 6f 73 74 75 73 65 72 5f 73 6f 63 6b 65 74 5f 64 69 72 7d 29 0a 20 20 20 20 20 20 20 | f.vhostuser_socket_dir})........ |
1d40 | 20 72 65 74 75 72 6e 20 64 61 74 61 0a 0a 20 20 20 20 64 65 66 20 5f 69 73 5f 76 61 6c 69 64 5f | .return.data......def._is_valid_ |
1d60 | 73 65 67 6d 65 6e 74 28 73 65 6c 66 2c 20 73 65 67 6d 65 6e 74 29 3a 0a 20 20 20 20 20 20 20 20 | segment(self,.segment):......... |
1d80 | 22 22 22 56 65 72 69 66 79 20 61 20 73 65 67 6d 65 6e 74 20 69 73 20 76 61 6c 69 64 20 66 6f 72 | """Verify.a.segment.is.valid.for |
1da0 | 20 74 68 65 20 4f 70 65 6e 44 61 79 6c 69 67 68 74 20 4d 65 63 68 61 6e 69 73 6d 44 72 69 76 65 | .the.OpenDaylight.MechanismDrive |
1dc0 | 72 2e 0a 0a 20 20 20 20 20 20 20 20 56 65 72 69 66 79 20 74 68 65 20 72 65 71 75 65 73 74 65 64 | r...........Verify.the.requested |
1de0 | 20 73 65 67 6d 65 6e 74 20 69 73 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 4f 44 4c 20 61 6e 64 | .segment.is.supported.by.ODL.and |
1e00 | 20 72 65 74 75 72 6e 20 54 72 75 65 20 6f 72 0a 20 20 20 20 20 20 20 20 46 61 6c 73 65 20 74 6f | .return.True.or.........False.to |
1e20 | 20 69 6e 64 69 63 61 74 65 20 74 68 69 73 20 74 6f 20 63 61 6c 6c 65 72 73 2e 0a 20 20 20 20 20 | .indicate.this.to.callers....... |
1e40 | 20 20 20 22 22 22 0a 0a 20 20 20 20 20 20 20 20 6e 65 74 77 6f 72 6b 5f 74 79 70 65 20 3d 20 73 | ..."""..........network_type.=.s |
1e60 | 65 67 6d 65 6e 74 5b 64 72 69 76 65 72 5f 61 70 69 2e 4e 45 54 57 4f 52 4b 5f 54 59 50 45 5d 0a | egment[driver_api.NETWORK_TYPE]. |
1e80 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 74 77 6f 72 6b 5f 74 79 70 65 20 69 6e 20 5b | ........return.network_type.in.[ |
1ea0 | 63 6f 6e 73 74 61 6e 74 73 2e 54 59 50 45 5f 4c 4f 43 41 4c 2c 20 63 6f 6e 73 74 61 6e 74 73 2e | constants.TYPE_LOCAL,.constants. |
1ec0 | 54 59 50 45 5f 47 52 45 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | TYPE_GRE,....................... |
1ee0 | 20 20 20 20 20 20 20 20 20 20 63 6f 6e 73 74 61 6e 74 73 2e 54 59 50 45 5f 56 58 4c 41 4e 2c 20 | ..........constants.TYPE_VXLAN,. |
1f00 | 63 6f 6e 73 74 61 6e 74 73 2e 54 59 50 45 5f 56 4c 41 4e 5d 0a 0a 20 20 20 20 64 65 66 20 5f 67 | constants.TYPE_VLAN]......def._g |
1f20 | 65 74 5f 76 69 66 5f 64 65 74 61 69 6c 73 28 73 65 6c 66 2c 20 76 69 66 5f 64 65 74 61 69 6c 73 | et_vif_details(self,.vif_details |
1f40 | 2c 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 5f 69 64 2c 20 76 69 66 5f 74 79 70 65 29 3a 0a 20 20 | ,.port_context_id,.vif_type):... |
1f60 | 20 20 20 20 20 20 76 69 66 5f 64 65 74 61 69 6c 73 20 3d 20 64 69 63 74 28 76 69 66 5f 64 65 74 | ......vif_details.=.dict(vif_det |
1f80 | 61 69 6c 73 29 0a 20 20 20 20 20 20 20 20 69 66 20 76 69 66 5f 74 79 70 65 20 3d 3d 20 70 6f 72 | ails).........if.vif_type.==.por |
1fa0 | 74 62 69 6e 64 69 6e 67 73 2e 56 49 46 5f 54 59 50 45 5f 56 48 4f 53 54 5f 55 53 45 52 3a 0a 20 | tbindings.VIF_TYPE_VHOST_USER:.. |
1fc0 | 20 20 20 20 20 20 20 20 20 20 20 73 6f 63 6b 65 74 5f 70 61 74 68 20 3d 20 6f 73 2e 70 61 74 68 | ...........socket_path.=.os.path |
1fe0 | 2e 6a 6f 69 6e 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65 6c 66 2e 76 68 6f 73 | .join(.................self.vhos |
2000 | 74 75 73 65 72 5f 73 6f 63 6b 65 74 5f 64 69 72 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | tuser_socket_dir,............... |
2020 | 20 20 28 73 65 6c 66 2e 70 6f 72 74 5f 70 72 65 66 69 78 20 2b 20 70 6f 72 74 5f 63 6f 6e 74 65 | ..(self.port_prefix.+.port_conte |
2040 | 78 74 5f 69 64 29 29 20 23 57 68 79 20 74 68 65 20 73 70 6c 69 63 65 3f 20 5b 3a 31 34 5d 29 0a | xt_id)).#Why.the.splice?.[:14]). |
2060 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 69 66 5f 64 65 74 61 69 6c 73 2e 75 70 64 61 74 65 28 | .............vif_details.update( |
2080 | 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 72 74 62 69 6e 64 69 6e 67 73 2e 56 | {.................portbindings.V |
20a0 | 48 4f 53 54 5f 55 53 45 52 5f 4d 4f 44 45 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | HOST_USER_MODE:................. |
20c0 | 70 6f 72 74 62 69 6e 64 69 6e 67 73 2e 56 48 4f 53 54 5f 55 53 45 52 5f 4d 4f 44 45 5f 53 45 52 | portbindings.VHOST_USER_MODE_SER |
20e0 | 56 45 52 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 70 6f 72 74 62 69 6e 64 69 6e | VER,.................#portbindin |
2100 | 67 73 2e 56 48 4f 53 54 5f 55 53 45 52 5f 4f 56 53 5f 50 4c 55 47 3a 20 54 72 75 65 2c 0a 20 20 | gs.VHOST_USER_OVS_PLUG:.True,... |
2120 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 72 74 62 69 6e 64 69 6e 67 73 2e 56 48 4f 53 54 | ..............portbindings.VHOST |
2140 | 5f 55 53 45 52 5f 53 4f 43 4b 45 54 3a 20 73 6f 63 6b 65 74 5f 70 61 74 68 0a 20 20 20 20 20 20 | _USER_SOCKET:.socket_path....... |
2160 | 20 20 20 20 20 20 7d 29 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 76 69 66 5f 64 65 74 61 | ......}).........return.vif_deta |
2180 | 69 6c 73 0a 0a 20 20 20 20 64 65 66 20 5f 5f 73 65 74 61 74 74 72 5f 5f 28 73 65 6c 66 2c 20 6e | ils......def.__setattr__(self,.n |
21a0 | 61 6d 65 2c 20 76 61 6c 75 65 29 3a 0a 20 20 20 20 20 20 20 20 23 20 72 61 69 73 65 73 20 41 74 | ame,.value):.........#.raises.At |
21c0 | 74 72 69 62 75 74 65 20 65 72 72 6f 72 20 69 66 20 74 68 65 20 63 6c 61 73 73 20 68 61 73 6e 27 | tribute.error.if.the.class.hasn' |
21e0 | 74 20 74 68 69 73 20 61 74 74 72 69 62 75 74 65 0a 20 20 20 20 20 20 20 20 67 65 74 61 74 74 72 | t.this.attribute.........getattr |
2200 | 28 74 79 70 65 28 73 65 6c 66 29 2c 20 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 73 75 70 65 72 | (type(self),.name).........super |
2220 | 28 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 2c 20 73 65 6c 66 | (VppNetworkTopologyElement,.self |
2240 | 29 2e 5f 5f 73 65 74 61 74 74 72 5f 5f 28 6e 61 6d 65 2c 20 76 61 6c 75 65 29 0a 00 00 00 00 00 | ).__setattr__(name,.value)...... |
2260 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2280 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
22a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
22c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
22e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2300 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2320 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2340 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2360 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2380 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
23a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
23c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
23e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2400 | 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 2e 70 79 00 00 00 00 00 00 00 00 00 00 00 00 00 | network_topology.py............. |
2420 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2440 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2460 | 00 00 00 00 30 30 30 36 34 34 20 00 30 30 30 37 36 35 20 00 30 30 30 30 32 34 20 00 30 30 30 30 | ....000644..000765..000024..0000 |
2480 | 30 30 33 31 31 35 30 20 31 32 37 32 37 35 32 34 30 34 30 20 30 31 35 31 34 35 00 20 30 00 00 00 | 0031150.12727524040.015145..0... |
24a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
24c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
24e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2500 | 00 75 73 74 61 72 00 30 30 77 64 65 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .ustar.00wdec................... |
2520 | 00 00 00 00 00 00 00 00 00 73 74 61 66 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | .........staff.................. |
2540 | 00 00 00 00 00 00 00 00 00 30 30 30 30 30 30 20 00 30 30 30 30 30 30 20 00 00 00 00 00 00 00 00 | .........000000..000000......... |
2560 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2580 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
25a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
25c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
25e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2600 | 23 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 32 30 31 35 2d 32 30 31 36 20 4f 70 65 6e 53 74 | #.Copyright.(c).2015-2016.OpenSt |
2620 | 61 63 6b 20 46 6f 75 6e 64 61 74 69 6f 6e 0a 23 20 41 6c 6c 20 52 69 67 68 74 73 20 52 65 73 65 | ack.Foundation.#.All.Rights.Rese |
2640 | 72 76 65 64 2e 0a 23 0a 23 20 20 20 20 4c 69 63 65 6e 73 65 64 20 75 6e 64 65 72 20 74 68 65 20 | rved..#.#....Licensed.under.the. |
2660 | 41 70 61 63 68 65 20 4c 69 63 65 6e 73 65 2c 20 56 65 72 73 69 6f 6e 20 32 2e 30 20 28 74 68 65 | Apache.License,.Version.2.0.(the |
2680 | 20 22 4c 69 63 65 6e 73 65 22 29 3b 20 79 6f 75 20 6d 61 79 0a 23 20 20 20 20 6e 6f 74 20 75 73 | ."License");.you.may.#....not.us |
26a0 | 65 20 74 68 69 73 20 66 69 6c 65 20 65 78 63 65 70 74 20 69 6e 20 63 6f 6d 70 6c 69 61 6e 63 65 | e.this.file.except.in.compliance |
26c0 | 20 77 69 74 68 20 74 68 65 20 4c 69 63 65 6e 73 65 2e 20 59 6f 75 20 6d 61 79 20 6f 62 74 61 69 | .with.the.License..You.may.obtai |
26e0 | 6e 0a 23 20 20 20 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 20 61 74 0a | n.#....a.copy.of.the.License.at. |
2700 | 23 0a 23 20 20 20 20 20 20 20 20 20 68 74 74 70 3a 2f 2f 77 77 77 2e 61 70 61 63 68 65 2e 6f 72 | #.#.........http://www.apache.or |
2720 | 67 2f 6c 69 63 65 6e 73 65 73 2f 4c 49 43 45 4e 53 45 2d 32 2e 30 0a 23 0a 23 20 20 20 20 55 6e | g/licenses/LICENSE-2.0.#.#....Un |
2740 | 6c 65 73 73 20 72 65 71 75 69 72 65 64 20 62 79 20 61 70 70 6c 69 63 61 62 6c 65 20 6c 61 77 20 | less.required.by.applicable.law. |
2760 | 6f 72 20 61 67 72 65 65 64 20 74 6f 20 69 6e 20 77 72 69 74 69 6e 67 2c 20 73 6f 66 74 77 61 72 | or.agreed.to.in.writing,.softwar |
2780 | 65 0a 23 20 20 20 20 64 69 73 74 72 69 62 75 74 65 64 20 75 6e 64 65 72 20 74 68 65 20 4c 69 63 | e.#....distributed.under.the.Lic |
27a0 | 65 6e 73 65 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 6f 6e 20 61 6e 20 22 41 53 20 49 53 | ense.is.distributed.on.an."AS.IS |
27c0 | 22 20 42 41 53 49 53 2c 20 57 49 54 48 4f 55 54 0a 23 20 20 20 20 57 41 52 52 41 4e 54 49 45 53 | ".BASIS,.WITHOUT.#....WARRANTIES |
27e0 | 20 4f 52 20 43 4f 4e 44 49 54 49 4f 4e 53 20 4f 46 20 41 4e 59 20 4b 49 4e 44 2c 20 65 69 74 68 | .OR.CONDITIONS.OF.ANY.KIND,.eith |
2800 | 65 72 20 65 78 70 72 65 73 73 20 6f 72 20 69 6d 70 6c 69 65 64 2e 20 53 65 65 20 74 68 65 0a 23 | er.express.or.implied..See.the.# |
2820 | 20 20 20 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 74 68 65 20 73 70 65 63 69 66 69 63 20 6c 61 6e | ....License.for.the.specific.lan |
2840 | 67 75 61 67 65 20 67 6f 76 65 72 6e 69 6e 67 20 70 65 72 6d 69 73 73 69 6f 6e 73 20 61 6e 64 20 | guage.governing.permissions.and. |
2860 | 6c 69 6d 69 74 61 74 69 6f 6e 73 0a 23 20 20 20 20 75 6e 64 65 72 20 74 68 65 20 4c 69 63 65 6e | limitations.#....under.the.Licen |
2880 | 73 65 2e 0a 0a 69 6d 70 6f 72 74 20 61 62 63 0a 69 6d 70 6f 72 74 20 69 6d 70 6f 72 74 6c 69 62 | se...import.abc.import.importlib |
28a0 | 0a 69 6d 70 6f 72 74 20 6c 6f 67 67 69 6e 67 0a 0a 69 6d 70 6f 72 74 20 73 69 78 0a 66 72 6f 6d | .import.logging..import.six.from |
28c0 | 20 73 69 78 2e 6d 6f 76 65 73 2e 75 72 6c 6c 69 62 20 69 6d 70 6f 72 74 20 70 61 72 73 65 0a 0a | .six.moves.urllib.import.parse.. |
28e0 | 66 72 6f 6d 20 6e 65 75 74 72 6f 6e 2e 65 78 74 65 6e 73 69 6f 6e 73 20 69 6d 70 6f 72 74 20 70 | from.neutron.extensions.import.p |
2900 | 6f 72 74 62 69 6e 64 69 6e 67 73 0a 66 72 6f 6d 20 6f 73 6c 6f 5f 6c 6f 67 20 69 6d 70 6f 72 74 | ortbindings.from.oslo_log.import |
2920 | 20 6c 6f 67 0a 66 72 6f 6d 20 6f 73 6c 6f 5f 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 20 69 6d 70 | .log.from.oslo_serialization.imp |
2940 | 6f 72 74 20 6a 73 6f 6e 75 74 69 6c 73 0a 0a 66 72 6f 6d 20 6e 65 74 77 6f 72 6b 69 6e 67 5f 6f | ort.jsonutils..from.networking_o |
2960 | 64 6c 2e 63 6f 6d 6d 6f 6e 20 69 6d 70 6f 72 74 20 63 61 63 68 65 0a 66 72 6f 6d 20 6e 65 74 77 | dl.common.import.cache.from.netw |
2980 | 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 63 6f 6d 6d 6f 6e 20 69 6d 70 6f 72 74 20 63 6c 69 65 6e 74 0a | orking_odl.common.import.client. |
29a0 | 66 72 6f 6d 20 6e 65 74 77 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 63 6f 6d 6d 6f 6e 20 69 6d 70 6f 72 | from.networking_odl.common.impor |
29c0 | 74 20 75 74 69 6c 73 0a 66 72 6f 6d 20 6e 65 74 77 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 5f 69 31 38 | t.utils.from.networking_odl._i18 |
29e0 | 6e 20 69 6d 70 6f 72 74 20 5f 4c 49 2c 20 5f 4c 57 2c 20 5f 4c 45 0a 66 72 6f 6d 20 6e 65 74 77 | n.import._LI,._LW,._LE.from.netw |
2a00 | 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 6d 6c 32 20 69 6d 70 6f 72 74 20 70 6f 72 74 5f 62 69 6e 64 69 | orking_odl.ml2.import.port_bindi |
2a20 | 6e 67 0a 0a 0a 4c 4f 47 20 3d 20 6c 6f 67 2e 67 65 74 4c 6f 67 67 65 72 28 5f 5f 6e 61 6d 65 5f | ng...LOG.=.log.getLogger(__name_ |
2a40 | 5f 29 0a 0a 0a 63 6c 61 73 73 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 4d 61 6e 61 67 65 | _)...class.NetworkTopologyManage |
2a60 | 72 28 70 6f 72 74 5f 62 69 6e 64 69 6e 67 2e 50 6f 72 74 42 69 6e 64 69 6e 67 43 6f 6e 74 72 6f | r(port_binding.PortBindingContro |
2a80 | 6c 6c 65 72 29 3a 0a 0a 20 20 20 20 23 20 74 68 65 20 66 69 72 73 74 20 76 61 6c 69 64 20 76 69 | ller):......#.the.first.valid.vi |
2aa0 | 66 20 74 79 70 65 20 77 69 6c 6c 20 62 65 20 63 68 6f 73 65 64 20 66 6f 6c 6c 6f 77 69 6e 67 20 | f.type.will.be.chosed.following. |
2ac0 | 74 68 65 20 6f 72 64 65 72 0a 20 20 20 20 23 20 6f 6e 20 74 68 69 73 20 6c 69 73 74 2e 20 54 68 | the.order.....#.on.this.list..Th |
2ae0 | 69 73 20 6c 69 73 74 20 63 61 6e 20 62 65 20 6d 6f 64 69 66 69 65 64 20 74 6f 20 61 64 61 70 74 | is.list.can.be.modified.to.adapt |
2b00 | 20 74 6f 20 75 73 65 72 20 70 72 65 66 65 72 65 6e 63 65 73 2e 0a 20 20 20 20 76 61 6c 69 64 5f | .to.user.preferences......valid_ |
2b20 | 76 69 66 5f 74 79 70 65 73 20 3d 20 5b 0a 20 20 20 20 20 20 20 20 70 6f 72 74 62 69 6e 64 69 6e | vif_types.=.[.........portbindin |
2b40 | 67 73 2e 56 49 46 5f 54 59 50 45 5f 56 48 4f 53 54 5f 55 53 45 52 2c 20 70 6f 72 74 62 69 6e 64 | gs.VIF_TYPE_VHOST_USER,.portbind |
2b60 | 69 6e 67 73 2e 56 49 46 5f 54 59 50 45 5f 4f 56 53 5d 0a 0a 20 20 20 20 23 20 4c 69 73 74 20 6f | ings.VIF_TYPE_OVS]......#.List.o |
2b80 | 66 20 63 6c 61 73 73 20 6e 61 6d 65 73 20 6f 66 20 72 65 67 69 73 74 65 72 65 64 20 69 6d 70 6c | f.class.names.of.registered.impl |
2ba0 | 65 6d 65 6e 74 61 74 69 6f 6e 73 20 6f 66 20 69 6e 74 65 72 66 61 63 65 0a 20 20 20 20 23 20 4e | ementations.of.interface.....#.N |
2bc0 | 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 0a 20 20 20 20 6e 65 74 77 6f 72 6b | etworkTopologyParser.....network |
2be0 | 5f 74 6f 70 6f 6c 6f 67 79 5f 70 61 72 73 65 72 73 20 3d 20 5b 0a 20 20 20 20 20 20 20 20 27 6e | _topology_parsers.=.[.........'n |
2c00 | 65 74 77 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 6d 6c 32 2e 6f 76 73 64 62 5f 74 6f 70 6f 6c 6f 67 79 | etworking_odl.ml2.ovsdb_topology |
2c20 | 2e 4f 76 73 64 62 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 27 2c 0a 20 20 | .OvsdbNetworkTopologyParser',... |
2c40 | 20 20 20 20 20 20 27 6e 65 74 77 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 6d 6c 32 2e 76 70 70 5f 74 6f | ......'networking_odl.ml2.vpp_to |
2c60 | 70 6f 6c 6f 67 79 2e 56 70 70 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 27 | pology.VppNetworkTopologyParser' |
2c80 | 5d 0a 0a 20 20 20 20 64 65 66 20 5f 5f 69 6e 69 74 5f 5f 28 73 65 6c 66 2c 20 76 69 66 5f 64 65 | ]......def.__init__(self,.vif_de |
2ca0 | 74 61 69 6c 73 3d 4e 6f 6e 65 2c 20 63 6c 69 65 6e 74 3d 4e 6f 6e 65 29 3a 0a 20 20 20 20 20 20 | tails=None,.client=None):....... |
2cc0 | 20 20 23 20 44 65 74 61 69 6c 73 20 66 6f 72 20 62 69 6e 64 69 6e 67 20 70 6f 72 74 0a 20 20 20 | ..#.Details.for.binding.port.... |
2ce0 | 20 20 20 20 20 73 65 6c 66 2e 5f 76 69 66 5f 64 65 74 61 69 6c 73 20 3d 20 76 69 66 5f 64 65 74 | .....self._vif_details.=.vif_det |
2d00 | 61 69 6c 73 20 6f 72 20 7b 70 6f 72 74 62 69 6e 64 69 6e 67 73 2e 43 41 50 5f 50 4f 52 54 5f 46 | ails.or.{portbindings.CAP_PORT_F |
2d20 | 49 4c 54 45 52 3a 20 54 72 75 65 7d 0a 0a 20 20 20 20 20 20 20 20 23 20 52 65 73 74 20 63 6c 69 | ILTER:.True}..........#.Rest.cli |
2d40 | 65 6e 74 20 75 73 65 64 20 66 6f 72 20 67 65 74 74 69 6e 67 20 6e 65 74 77 6f 72 6b 20 74 6f 70 | ent.used.for.getting.network.top |
2d60 | 6f 6c 6f 67 79 20 66 72 6f 6d 20 4f 44 4c 0a 20 20 20 20 20 20 20 20 73 65 6c 66 2e 5f 63 6c 69 | ology.from.ODL.........self._cli |
2d80 | 65 6e 74 20 3d 20 63 6c 69 65 6e 74 20 6f 72 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 43 | ent.=.client.or.NetworkTopologyC |
2da0 | 6c 69 65 6e 74 2e 63 72 65 61 74 65 5f 63 6c 69 65 6e 74 28 29 0a 0a 20 20 20 20 20 20 20 20 23 | lient.create_client()..........# |
2dc0 | 20 54 61 62 6c 65 20 6f 66 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 | .Table.of.NetworkTopologyElement |
2de0 | 0a 20 20 20 20 20 20 20 20 73 65 6c 66 2e 5f 65 6c 65 6d 65 6e 74 73 5f 62 79 5f 69 70 20 3d 20 | .........self._elements_by_ip.=. |
2e00 | 63 61 63 68 65 2e 43 61 63 68 65 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 6c 66 2e 5f 66 | cache.Cache(.............self._f |
2e20 | 65 74 63 68 5f 61 6e 64 5f 70 61 72 73 65 5f 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 29 | etch_and_parse_network_topology) |
2e40 | 0a 0a 20 20 20 20 20 20 20 20 23 20 50 61 72 73 65 72 73 20 75 73 65 64 20 66 6f 72 20 70 72 6f | ..........#.Parsers.used.for.pro |
2e60 | 63 65 73 73 69 6e 67 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 0a 20 20 20 20 20 20 20 | cessing.network.topology........ |
2e80 | 20 73 65 6c 66 2e 5f 70 61 72 73 65 72 73 20 3d 20 6c 69 73 74 28 73 65 6c 66 2e 5f 63 72 65 61 | .self._parsers.=.list(self._crea |
2ea0 | 74 65 5f 70 61 72 73 65 72 73 28 29 29 0a 0a 20 20 20 20 64 65 66 20 62 69 6e 64 5f 70 6f 72 74 | te_parsers())......def.bind_port |
2ec0 | 28 73 65 6c 66 2c 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 29 3a 0a 20 20 20 20 20 20 20 20 22 22 | (self,.port_context):........."" |
2ee0 | 22 53 65 74 20 62 69 6e 64 69 6e 67 20 66 6f 72 20 61 20 76 61 6c 69 64 20 73 65 67 6d 65 6e 74 | "Set.binding.for.a.valid.segment |
2f00 | 0a 0a 20 20 20 20 20 20 20 20 22 22 22 0a 20 20 20 20 20 20 20 20 68 6f 73 74 5f 6e 61 6d 65 20 | ..........""".........host_name. |
2f20 | 3d 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2e 68 6f 73 74 0a 20 20 20 20 20 20 20 20 4c 4f 47 2e | =.port_context.host.........LOG. |
2f40 | 64 65 62 75 67 28 27 50 72 6f 63 65 73 73 69 6e 67 20 70 6f 72 74 20 66 6f 72 20 68 6f 73 74 3a | debug('Processing.port.for.host: |
2f60 | 20 25 73 27 2c 20 68 6f 73 74 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 | .%s',.host_name).........element |
2f80 | 73 20 3d 20 6c 69 73 74 28 29 0a 20 20 20 20 20 20 20 20 74 72 79 3a 0a 20 20 20 20 20 20 20 20 | s.=.list().........try:......... |
2fa0 | 20 20 20 20 23 20 41 70 70 65 6e 64 20 74 6f 20 65 6d 70 74 79 20 6c 69 73 74 20 74 6f 20 61 64 | ....#.Append.to.empty.list.to.ad |
2fc0 | 64 20 61 73 20 6d 75 63 68 20 65 6c 65 6d 65 6e 74 73 20 61 73 20 70 6f 73 73 69 62 6c 65 0a 20 | d.as.much.elements.as.possible.. |
2fe0 | 20 20 20 20 20 20 20 20 20 20 20 23 20 69 6e 20 74 68 65 20 63 61 73 65 20 69 74 20 72 61 69 73 | ...........#.in.the.case.it.rais |
3000 | 65 73 20 61 6e 20 65 78 63 65 70 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 65 6d | es.an.exception.............elem |
3020 | 65 6e 74 73 2e 65 78 74 65 6e 64 28 73 65 6c 66 2e 5f 66 65 74 63 68 5f 65 6c 65 6d 65 6e 74 73 | ents.extend(self._fetch_elements |
3040 | 5f 62 79 5f 68 6f 73 74 28 68 6f 73 74 5f 6e 61 6d 65 29 29 0a 20 20 20 20 20 20 20 20 65 78 63 | _by_host(host_name)).........exc |
3060 | 65 70 74 20 45 78 63 65 70 74 69 6f 6e 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 | ept.Exception:.............LOG.e |
3080 | 78 63 65 70 74 69 6f 6e 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 45 28 27 45 | xception(................._LE('E |
30a0 | 72 72 6f 72 20 66 65 74 63 68 69 6e 67 20 65 6c 65 6d 65 6e 74 73 20 66 6f 72 20 68 6f 73 74 20 | rror.fetching.elements.for.host. |
30c0 | 25 28 68 6f 73 74 5f 6e 61 6d 65 29 72 2e 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | %(host_name)r.'),............... |
30e0 | 20 20 7b 27 68 6f 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 7d 2c 20 65 78 63 5f | ..{'host_name':.host_name},.exc_ |
3100 | 69 6e 66 6f 3d 31 29 0a 0a 20 20 20 20 20 20 20 20 69 66 20 6e 6f 74 20 65 6c 65 6d 65 6e 74 73 | info=1)..........if.not.elements |
3120 | 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 49 6e 20 63 61 73 65 20 69 74 20 77 61 73 6e 27 | :.............#.In.case.it.wasn' |
3140 | 74 20 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 61 6e 79 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c | t.able.to.find.any.network.topol |
3160 | 6f 67 79 20 65 6c 65 6d 65 6e 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 66 6f 72 20 67 69 | ogy.element.............#.for.gi |
3180 | 76 65 6e 20 68 6f 73 74 20 74 68 65 6e 20 69 74 20 75 73 65 73 20 74 68 65 20 6c 65 67 61 63 79 | ven.host.then.it.uses.the.legacy |
31a0 | 20 4f 56 53 20 6f 6e 65 20 6b 65 65 70 69 6e 67 20 74 68 65 20 6f 6c 64 0a 20 20 20 20 20 20 20 | .OVS.one.keeping.the.old........ |
31c0 | 20 20 20 20 20 23 20 62 65 68 61 76 69 6f 75 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 | .....#.behaviour.............LOG |
31e0 | 2e 77 61 72 6e 69 6e 67 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 57 28 27 55 | .warning(................._LW('U |
3200 | 73 69 6e 67 20 6c 65 67 61 63 79 20 4f 56 53 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 | sing.legacy.OVS.network.topology |
3220 | 20 65 6c 65 6d 65 6e 74 20 66 6f 72 20 70 6f 72 74 20 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 | .element.for.port.'............. |
3240 | 20 20 20 20 20 20 20 20 27 62 69 6e 64 69 6e 67 20 66 6f 72 20 68 6f 73 74 3a 20 25 28 68 6f 73 | ........'binding.for.host:.%(hos |
3260 | 74 5f 6e 61 6d 65 29 72 2e 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 68 | t_name)r.'),.................{'h |
3280 | 6f 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 7d 29 0a 0a 20 20 20 20 20 20 20 20 | ost_name':.host_name}).......... |
32a0 | 20 20 20 20 23 20 49 6d 70 6f 72 74 65 64 20 68 65 72 65 20 74 6f 20 61 76 6f 69 64 20 63 79 63 | ....#.Imported.here.to.avoid.cyc |
32c0 | 6c 69 63 20 6d 6f 64 75 6c 65 20 64 65 70 65 6e 64 65 6e 63 69 65 73 0a 20 20 20 20 20 20 20 20 | lic.module.dependencies......... |
32e0 | 20 20 20 20 23 20 54 4f 44 4f 20 28 77 64 65 63 29 3a 20 41 64 64 20 76 70 70 20 74 6f 70 6f 6c | ....#.TODO.(wdec):.Add.vpp.topol |
3300 | 6f 67 79 20 69 6d 70 6f 72 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 72 6f 6d 20 6e 65 74 77 | ogy.import.............from.netw |
3320 | 6f 72 6b 69 6e 67 5f 6f 64 6c 2e 6d 6c 32 20 69 6d 70 6f 72 74 20 6f 76 73 64 62 5f 74 6f 70 6f | orking_odl.ml2.import.ovsdb_topo |
3340 | 6c 6f 67 79 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 73 20 3d 20 5b 6f 76 73 | logy.............elements.=.[ovs |
3360 | 64 62 5f 74 6f 70 6f 6c 6f 67 79 2e 4f 76 73 64 62 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 | db_topology.OvsdbNetworkTopology |
3380 | 45 6c 65 6d 65 6e 74 28 29 5d 0a 0a 20 20 20 20 20 20 20 20 23 20 54 4f 44 4f 28 46 65 64 65 72 | Element()]..........#.TODO(Feder |
33a0 | 69 63 6f 20 52 65 73 73 69 29 3a 20 69 6e 20 74 68 65 20 63 61 73 65 20 74 68 65 72 65 20 61 72 | ico.Ressi):.in.the.case.there.ar |
33c0 | 65 20 6d 6f 72 65 20 63 61 6e 64 69 64 61 74 65 20 76 69 72 74 75 61 6c 0a 20 20 20 20 20 20 20 | e.more.candidate.virtual........ |
33e0 | 20 23 20 73 77 69 74 63 68 65 73 20 69 6e 73 74 61 6e 63 65 73 20 66 6f 72 20 74 68 65 20 73 61 | .#.switches.instances.for.the.sa |
3400 | 6d 65 20 68 6f 73 74 20 69 74 20 63 68 6f 73 65 73 20 6f 6e 65 20 66 6f 72 20 62 69 6e 64 69 6e | me.host.it.choses.one.for.bindin |
3420 | 67 0a 20 20 20 20 20 20 20 20 23 20 70 6f 72 74 2e 20 41 73 20 74 68 65 72 65 20 69 73 6e 27 74 | g.........#.port..As.there.isn't |
3440 | 20 61 6e 79 20 6b 6e 6f 77 20 77 61 79 20 74 6f 20 70 65 72 66 6f 72 6d 20 74 68 69 73 20 73 65 | .any.know.way.to.perform.this.se |
3460 | 6c 65 63 74 69 6f 6e 20 69 74 0a 20 20 20 20 20 20 20 20 23 20 73 65 6c 65 63 74 73 20 61 20 56 | lection.it.........#.selects.a.V |
3480 | 49 46 20 74 79 70 65 20 74 68 61 74 20 69 73 20 76 61 6c 69 64 20 66 6f 72 20 61 6c 6c 20 73 77 | IF.type.that.is.valid.for.all.sw |
34a0 | 69 74 63 68 65 73 20 74 68 61 74 20 68 61 76 65 0a 20 20 20 20 20 20 20 20 23 20 62 65 65 6e 20 | itches.that.have.........#.been. |
34c0 | 66 6f 75 6e 64 20 61 6e 64 20 61 20 56 49 46 20 74 79 70 65 20 76 61 6c 69 64 20 66 6f 72 20 61 | found.and.a.VIF.type.valid.for.a |
34e0 | 6c 6c 20 74 68 65 6d 2e 20 54 68 69 73 20 68 61 73 20 74 6f 20 62 65 20 69 6d 70 72 6f 76 65 64 | ll.them..This.has.to.be.improved |
3500 | 0a 20 20 20 20 20 20 20 20 66 6f 72 20 76 69 66 5f 74 79 70 65 20 69 6e 20 73 65 6c 66 2e 76 61 | .........for.vif_type.in.self.va |
3520 | 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 69 66 5f 74 | lid_vif_types:.............vif_t |
3540 | 79 70 65 5f 69 73 5f 76 61 6c 69 64 5f 66 6f 72 5f 61 6c 6c 20 3d 20 54 72 75 65 0a 20 20 20 20 | ype_is_valid_for_all.=.True..... |
3560 | 20 20 20 20 20 20 20 20 66 6f 72 20 65 6c 65 6d 65 6e 74 20 69 6e 20 65 6c 65 6d 65 6e 74 73 3a | ........for.element.in.elements: |
3580 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 76 69 66 5f 74 79 70 65 20 6e 6f 74 | .................if.vif_type.not |
35a0 | 20 69 6e 20 65 6c 65 6d 65 6e 74 2e 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 3a 0a 20 20 20 | .in.element.valid_vif_types:.... |
35c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 69 74 20 69 73 20 69 6e 76 61 6c 69 64 | .................#.it.is.invalid |
35e0 | 20 66 6f 72 20 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 65 6c 65 6d 65 6e 74 3a 20 64 69 73 63 61 | .for.at.least.one.element:.disca |
3600 | 72 64 20 69 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 69 66 5f 74 79 | rd.it.....................vif_ty |
3620 | 70 65 5f 69 73 5f 76 61 6c 69 64 5f 66 6f 72 5f 61 6c 6c 20 3d 20 46 61 6c 73 65 0a 20 20 20 20 | pe_is_valid_for_all.=.False..... |
3640 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 0a 20 20 20 20 20 20 20 20 23 54 | ................break.........#T |
3660 | 4f 44 4f 20 28 77 64 65 63 29 3a 20 54 68 69 73 20 6e 65 65 64 73 20 74 6f 20 64 65 61 6c 20 77 | ODO.(wdec):.This.needs.to.deal.w |
3680 | 69 74 68 20 6e 6f 74 20 61 6c 6c 20 6e 65 74 77 6f 72 6b 20 65 6c 65 6d 65 6e 74 73 0a 20 20 20 | ith.not.all.network.elements.... |
36a0 | 20 20 20 20 20 23 20 73 75 70 70 6f 72 74 69 6e 67 20 61 6c 6c 20 62 69 6e 64 69 6e 67 20 74 79 | .....#.supporting.all.binding.ty |
36c0 | 70 65 73 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 76 69 66 5f 74 79 70 65 5f 69 73 5f | pes..............if.vif_type_is_ |
36e0 | 76 61 6c 69 64 5f 66 6f 72 5f 61 6c 6c 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 | valid_for_all:.................# |
3700 | 20 54 68 69 73 20 69 73 20 74 68 65 20 62 65 73 74 20 56 49 46 20 74 79 70 65 20 76 61 6c 69 64 | .This.is.the.best.VIF.type.valid |
3720 | 20 66 6f 72 20 61 6c 6c 20 65 6c 65 6d 65 6e 74 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .for.all.elements............... |
3740 | 20 20 4c 4f 47 2e 64 65 62 75 67 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ..LOG.debug(.................... |
3760 | 20 22 46 6f 75 6e 64 20 56 49 46 20 74 79 70 65 20 25 28 76 69 66 5f 74 79 70 65 29 72 20 76 61 | ."Found.VIF.type.%(vif_type)r.va |
3780 | 6c 69 64 20 66 6f 72 20 61 6c 6c 20 6e 65 74 77 6f 72 6b 20 22 0a 20 20 20 20 20 20 20 20 20 20 | lid.for.all.network."........... |
37a0 | 20 20 20 20 20 20 20 20 20 20 22 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 73 20 66 6f 72 | .........."topology.elements.for |
37c0 | 20 68 6f 73 74 20 25 28 68 6f 73 74 5f 6e 61 6d 65 29 72 2e 22 2c 0a 20 20 20 20 20 20 20 20 20 | .host.%(host_name)r.",.......... |
37e0 | 20 20 20 20 20 20 20 20 20 20 20 7b 27 76 69 66 5f 74 79 70 65 27 3a 20 76 69 66 5f 74 79 70 65 | ...........{'vif_type':.vif_type |
3800 | 2c 20 27 68 6f 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 7d 29 0a 0a 20 20 20 20 | ,.'host_name':.host_name})...... |
3820 | 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 65 6c 65 6d 65 6e 74 20 69 6e 20 65 6c 65 6d 65 | ............for.element.in.eleme |
3840 | 6e 74 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 49 74 20 61 73 | nts:.....................#.It.as |
3860 | 73 75 6d 65 73 20 74 68 61 74 20 61 6e 79 20 65 6c 65 6d 65 6e 74 20 63 6f 75 6c 64 20 62 65 20 | sumes.that.any.element.could.be. |
3880 | 67 6f 6f 64 20 66 6f 72 20 67 69 76 65 6e 20 68 6f 73 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 | good.for.given.host............. |
38a0 | 20 20 20 20 20 20 20 20 23 20 49 6e 20 6d 6f 73 74 20 6f 66 20 74 68 65 20 63 61 73 65 73 20 49 | ........#.In.most.of.the.cases.I |
38c0 | 20 65 78 70 65 63 74 20 65 78 61 63 74 65 6c 79 20 6f 6e 65 20 65 6c 65 6d 65 6e 74 20 66 6f 72 | .expect.exactely.one.element.for |
38e0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 65 76 65 72 79 20 63 6f 6d | .....................#.every.com |
3900 | 70 75 74 65 20 68 6f 73 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 | pute.host.....................tr |
3920 | 79 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 | y:.........................retur |
3940 | 6e 20 65 6c 65 6d 65 6e 74 2e 62 69 6e 64 5f 70 6f 72 74 28 0a 20 20 20 20 20 20 20 20 20 20 20 | n.element.bind_port(............ |
3960 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2c 20 76 | .................port_context,.v |
3980 | 69 66 5f 74 79 70 65 2c 20 73 65 6c 66 2e 5f 76 69 66 5f 64 65 74 61 69 6c 73 29 0a 0a 20 20 20 | if_type,.self._vif_details)..... |
39a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 45 78 63 65 70 74 69 6f | .................except.Exceptio |
39c0 | 6e 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 | n:.........................LOG.e |
39e0 | 78 63 65 70 74 69 6f 6e 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | xception(....................... |
3a00 | 20 20 20 20 20 20 5f 4c 45 28 27 4e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d | ......_LE('Network.topology.elem |
3a20 | 65 6e 74 20 68 61 73 20 66 61 69 6c 65 64 20 62 69 6e 64 69 6e 67 20 27 0a 20 20 20 20 20 20 20 | ent.has.failed.binding.'........ |
3a40 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 70 6f 72 74 3a 5c | .........................'port:\ |
3a60 | 6e 25 28 65 6c 65 6d 65 6e 74 29 73 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | n%(element)s'),................. |
3a80 | 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 65 6c 65 6d 65 6e 74 27 3a 20 65 6c 65 6d 65 6e 74 2e | ............{'element':.element. |
3aa0 | 74 6f 5f 6a 73 6f 6e 28 29 7d 29 0a 0a 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 72 72 6f 72 28 0a | to_json()})..........LOG.error(. |
3ac0 | 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 45 28 27 55 6e 61 62 6c 65 20 74 6f 20 62 69 6e 64 20 | ............_LE('Unable.to.bind. |
3ae0 | 70 6f 72 74 20 65 6c 65 6d 65 6e 74 20 66 6f 72 20 67 69 76 65 6e 20 68 6f 73 74 20 61 6e 64 20 | port.element.for.given.host.and. |
3b00 | 76 61 6c 69 64 20 56 49 46 20 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 74 79 70 | valid.VIF.'.................'typ |
3b20 | 65 73 3a 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 5c 74 68 6f 73 74 6e 61 | es:\n'.................'\thostna |
3b40 | 6d 65 3a 20 25 28 68 6f 73 74 5f 6e 61 6d 65 29 73 5c 6e 27 0a 20 20 20 20 20 20 20 20 20 20 20 | me:.%(host_name)s\n'............ |
3b60 | 20 20 20 20 20 27 5c 74 76 61 6c 69 64 20 56 49 46 20 74 79 70 65 73 3a 20 25 28 76 61 6c 69 64 | .....'\tvalid.VIF.types:.%(valid |
3b80 | 5f 76 69 66 5f 74 79 70 65 73 29 73 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 68 6f | _vif_types)s'),.............{'ho |
3ba0 | 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 2c 0a 20 20 20 20 20 20 20 20 20 20 20 | st_name':.host_name,............ |
3bc0 | 20 20 27 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 27 3a 20 27 2c 20 27 2e 6a 6f 69 6e 28 73 | ..'valid_vif_types':.',.'.join(s |
3be0 | 65 6c 66 2e 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 29 7d 29 0a 20 20 20 20 20 20 20 20 23 | elf.valid_vif_types)}).........# |
3c00 | 20 54 44 4f 4f 28 46 65 64 65 72 69 63 6f 20 52 65 73 73 69 29 3a 20 73 68 6f 75 6c 64 20 49 20 | .TDOO(Federico.Ressi):.should.I. |
3c20 | 72 61 69 73 65 20 61 6e 20 65 78 63 65 70 74 69 6f 6e 20 68 65 72 65 3f 0a 0a 20 20 20 20 64 65 | raise.an.exception.here?......de |
3c40 | 66 20 5f 63 72 65 61 74 65 5f 70 61 72 73 65 72 73 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 20 | f._create_parsers(self):........ |
3c60 | 20 66 6f 72 20 70 61 72 73 65 72 5f 6e 61 6d 65 20 69 6e 20 73 65 6c 66 2e 6e 65 74 77 6f 72 6b | .for.parser_name.in.self.network |
3c80 | 5f 74 6f 70 6f 6c 6f 67 79 5f 70 61 72 73 65 72 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 | _topology_parsers:.............t |
3ca0 | 72 79 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 20 4e 65 74 77 6f 72 | ry:.................yield.Networ |
3cc0 | 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 2e 63 72 65 61 74 65 5f 70 61 72 73 65 72 28 70 61 | kTopologyParser.create_parser(pa |
3ce0 | 72 73 65 72 5f 6e 61 6d 65 29 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 45 | rser_name)..............except.E |
3d00 | 78 63 65 70 74 69 6f 6e 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 78 | xception:.................LOG.ex |
3d20 | 63 65 70 74 69 6f 6e 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 45 | ception(....................._LE |
3d40 | 28 27 45 72 72 6f 72 20 69 6e 69 74 69 61 6c 69 7a 69 6e 67 20 74 6f 70 6f 6c 6f 67 79 20 70 61 | ('Error.initializing.topology.pa |
3d60 | 72 73 65 72 3a 20 25 28 70 61 72 73 65 72 5f 6e 61 6d 65 29 72 27 29 2c 0a 20 20 20 20 20 20 20 | rser:.%(parser_name)r'),........ |
3d80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 27 70 61 72 73 65 72 5f 6e 61 6d 65 27 3a 20 70 61 72 | .............{'parser_name':.par |
3da0 | 73 65 72 5f 6e 61 6d 65 7d 29 0a 0a 20 20 20 20 64 65 66 20 5f 66 65 74 63 68 5f 65 6c 65 6d 65 | ser_name})......def._fetch_eleme |
3dc0 | 6e 74 73 5f 62 79 5f 68 6f 73 74 28 73 65 6c 66 2c 20 68 6f 73 74 5f 6e 61 6d 65 2c 20 63 61 63 | nts_by_host(self,.host_name,.cac |
3de0 | 68 65 5f 74 69 6d 65 6f 75 74 3d 36 30 2e 30 29 3a 0a 20 20 20 20 20 20 20 20 27 27 27 59 69 65 | he_timeout=60.0):.........'''Yie |
3e00 | 6c 64 73 20 61 6c 6c 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 | lds.all.network.topology.element |
3e20 | 73 20 72 65 66 65 72 72 69 6e 67 20 74 6f 20 67 69 76 65 6e 20 68 6f 73 74 20 6e 61 6d 65 0a 0a | s.referring.to.given.host.name.. |
3e40 | 20 20 20 20 20 20 20 20 27 27 27 0a 0a 20 20 20 20 20 20 20 20 68 6f 73 74 5f 61 64 64 72 65 73 | ........'''..........host_addres |
3e60 | 73 65 73 20 3d 20 5b 68 6f 73 74 5f 6e 61 6d 65 5d 0a 20 20 20 20 20 20 20 20 74 72 79 3a 0a 20 | ses.=.[host_name].........try:.. |
3e80 | 20 20 20 20 20 20 20 20 20 20 20 23 20 49 74 20 75 73 65 73 20 62 6f 74 68 20 63 6f 6d 70 75 74 | ...........#.It.uses.both.comput |
3ea0 | 65 20 68 6f 73 74 20 6e 61 6d 65 20 61 6e 64 20 6b 6e 6f 77 6e 20 49 50 20 61 64 64 72 65 73 73 | e.host.name.and.known.IP.address |
3ec0 | 65 73 20 74 6f 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 72 65 63 6f 67 6e 69 7a 65 20 74 6f | es.to.............#.recognize.to |
3ee0 | 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 73 20 76 61 6c 69 64 20 66 6f 72 20 67 69 76 65 6e 20 | pology.elements.valid.for.given. |
3f00 | 63 6f 6d 70 75 74 65 64 20 68 6f 73 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 70 5f 61 64 64 | computed.host.............ip_add |
3f20 | 72 65 73 73 65 73 20 3d 20 75 74 69 6c 73 2e 67 65 74 5f 61 64 64 72 65 73 73 65 73 5f 62 79 5f | resses.=.utils.get_addresses_by_ |
3f40 | 6e 61 6d 65 28 68 6f 73 74 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 45 | name(host_name).........except.E |
3f60 | 78 63 65 70 74 69 6f 6e 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 70 5f 61 64 64 72 65 73 73 | xception:.............ip_address |
3f80 | 65 73 20 3d 20 5b 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 78 63 65 70 74 69 6f | es.=.[].............LOG.exceptio |
3fa0 | 6e 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 45 28 27 55 6e 61 62 6c 65 20 74 | n(................._LE('Unable.t |
3fc0 | 6f 20 72 65 73 6f 6c 76 65 20 49 50 20 61 64 64 72 65 73 73 65 73 20 66 6f 72 20 68 6f 73 74 20 | o.resolve.IP.addresses.for.host. |
3fe0 | 25 28 68 6f 73 74 5f 6e 61 6d 65 29 72 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | %(host_name)r'),................ |
4000 | 20 7b 27 68 6f 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 7d 29 0a 20 20 20 20 20 | .{'host_name':.host_name})...... |
4020 | 20 20 20 65 6c 73 65 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 68 6f 73 74 5f 61 64 64 72 65 73 | ...else:.............host_addres |
4040 | 73 65 73 2e 65 78 74 65 6e 64 28 69 70 5f 61 64 64 72 65 73 73 65 73 29 0a 0a 20 20 20 20 20 20 | ses.extend(ip_addresses)........ |
4060 | 20 20 79 69 65 6c 64 5f 65 6c 65 6d 65 6e 74 73 20 3d 20 73 65 74 28 29 0a 20 20 20 20 20 20 20 | ..yield_elements.=.set()........ |
4080 | 20 74 72 79 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 5f 5f 2c 20 65 6c 65 6d 65 6e | .try:.............for.__,.elemen |
40a0 | 74 20 69 6e 20 73 65 6c 66 2e 5f 65 6c 65 6d 65 6e 74 73 5f 62 79 5f 69 70 2e 66 65 74 63 68 5f | t.in.self._elements_by_ip.fetch_ |
40c0 | 61 6c 6c 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 6f 73 74 5f 61 64 | all(.....................host_ad |
40e0 | 64 72 65 73 73 65 73 2c 20 63 61 63 68 65 5f 74 69 6d 65 6f 75 74 29 3a 0a 20 20 20 20 20 20 20 | dresses,.cache_timeout):........ |
4100 | 20 20 20 20 20 20 20 20 20 23 20 79 69 65 6c 64 73 20 65 76 65 72 79 20 65 6c 65 6d 65 6e 74 20 | .........#.yields.every.element. |
4120 | 6f 6e 6c 79 20 6f 6e 63 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 65 6c 65 | only.once.................if.ele |
4140 | 6d 65 6e 74 20 6e 6f 74 20 69 6e 20 79 69 65 6c 64 5f 65 6c 65 6d 65 6e 74 73 3a 0a 20 20 20 20 | ment.not.in.yield_elements:..... |
4160 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 79 69 65 6c 64 5f 65 6c 65 6d 65 6e 74 73 2e 61 | ................yield_elements.a |
4180 | 64 64 28 65 6c 65 6d 65 6e 74 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | dd(element)..................... |
41a0 | 79 69 65 6c 64 20 65 6c 65 6d 65 6e 74 0a 0a 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 63 61 | yield.element..........except.ca |
41c0 | 63 68 65 2e 43 61 63 68 65 46 65 74 63 68 45 72 72 6f 72 20 61 73 20 65 72 72 6f 72 3a 0a 20 20 | che.CacheFetchError.as.error:... |
41e0 | 20 20 20 20 20 20 20 20 20 20 23 20 54 68 69 73 20 65 72 72 6f 72 20 69 73 20 65 78 70 65 63 74 | ..........#.This.error.is.expect |
4200 | 65 64 20 6f 6e 20 6d 6f 73 74 20 6f 66 20 74 68 65 20 63 61 73 65 73 20 62 65 63 61 75 73 65 20 | ed.on.most.of.the.cases.because. |
4220 | 74 79 70 69 63 61 6c 6c 79 20 6e 6f 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 61 6c 6c 20 | typically.not.............#.all. |
4240 | 68 6f 73 74 5f 61 64 64 72 65 73 73 65 73 20 6d 61 70 73 20 74 6f 20 61 20 6e 65 74 77 6f 72 6b | host_addresses.maps.to.a.network |
4260 | 20 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 | .topology.element..............i |
4280 | 66 20 79 69 65 6c 64 5f 65 6c 65 6d 65 6e 74 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | f.yield_elements:............... |
42a0 | 20 20 23 20 41 73 20 77 65 20 6e 65 65 64 20 6f 6e 6c 79 20 6f 6e 65 20 65 6c 65 6d 65 6e 74 20 | ..#.As.we.need.only.one.element. |
42c0 | 66 6f 72 20 65 76 65 72 79 20 68 6f 73 74 20 77 65 20 69 67 6e 6f 72 65 20 74 68 65 0a 20 20 20 | for.every.host.we.ignore.the.... |
42e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 63 61 73 65 20 69 6e 20 77 68 69 63 68 20 6f 74 68 | .............#.case.in.which.oth |
4300 | 65 72 73 20 68 6f 73 74 20 61 64 64 72 65 73 73 65 73 65 73 20 64 69 64 6e 27 74 20 6d 61 70 20 | ers.host.addresseses.didn't.map. |
4320 | 74 6f 20 61 6e 79 20 68 6f 73 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e | to.any.host.................LOG. |
4340 | 64 65 62 75 67 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 48 6f 73 74 | debug(.....................'Host |
4360 | 20 61 64 64 72 65 73 73 65 73 20 6e 6f 74 20 66 6f 75 6e 64 20 69 6e 20 6e 65 74 77 6f 72 6b 69 | .addresses.not.found.in.networki |
4380 | 6e 67 20 74 6f 70 6f 6c 6f 67 79 3a 20 25 73 27 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ng.topology:.%s',............... |
43a0 | 20 20 20 20 20 20 27 2c 20 27 2e 6a 6f 69 6e 28 65 72 72 6f 72 2e 6d 69 73 73 69 6e 67 5f 6b 65 | ......',.'.join(error.missing_ke |
43c0 | 79 73 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 3a 0a 20 20 20 20 20 20 20 20 20 | ys)).............else:.......... |
43e0 | 20 20 20 20 20 20 20 4c 4f 47 2e 65 78 63 65 70 74 69 6f 6e 28 0a 20 20 20 20 20 20 20 20 20 20 | .......LOG.exception(........... |
4400 | 20 20 20 20 20 20 20 20 20 20 5f 4c 45 28 27 4e 6f 20 73 75 63 68 20 6e 65 74 77 6f 72 6b 20 74 | .........._LE('No.such.network.t |
4420 | 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 73 20 66 6f 72 20 67 69 76 65 6e 20 68 6f 73 74 20 | opology.elements.for.given.host. |
4440 | 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 25 28 68 6f 73 | '.........................'%(hos |
4460 | 74 5f 6e 61 6d 65 29 72 20 61 6e 64 20 67 69 76 65 6e 20 49 50 73 3a 20 25 28 69 70 5f 61 64 64 | t_name)r.and.given.IPs:.%(ip_add |
4480 | 72 65 73 73 65 73 29 73 2e 27 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | resses)s.'),.................... |
44a0 | 20 7b 27 68 6f 73 74 5f 6e 61 6d 65 27 3a 20 68 6f 73 74 5f 6e 61 6d 65 2c 0a 20 20 20 20 20 20 | .{'host_name':.host_name,....... |
44c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 69 70 5f 61 64 64 72 65 73 73 65 73 27 3a 20 22 | ...............'ip_addresses':." |
44e0 | 2c 20 22 2e 6a 6f 69 6e 28 69 70 5f 61 64 64 72 65 73 73 65 73 29 7d 29 0a 20 20 20 20 20 20 20 | ,.".join(ip_addresses)})........ |
4500 | 20 20 20 20 20 20 20 20 20 65 72 72 6f 72 2e 72 65 72 61 69 73 65 5f 63 61 75 73 65 28 29 0a 0a | .........error.reraise_cause().. |
4520 | 20 20 20 20 64 65 66 20 5f 66 65 74 63 68 5f 61 6e 64 5f 70 61 72 73 65 5f 6e 65 74 77 6f 72 6b | ....def._fetch_and_parse_network |
4540 | 5f 74 6f 70 6f 6c 6f 67 79 28 73 65 6c 66 2c 20 61 64 64 72 65 73 73 65 73 29 3a 0a 20 20 20 20 | _topology(self,.addresses):..... |
4560 | 20 20 20 20 23 20 54 68 65 20 63 61 63 68 65 20 63 61 6c 6c 73 20 74 68 69 73 20 6d 65 74 68 6f | ....#.The.cache.calls.this.metho |
4580 | 64 20 74 6f 20 66 65 63 74 68 20 6e 65 77 20 65 6c 65 6d 65 6e 74 73 20 77 68 65 6e 20 61 74 20 | d.to.fecth.new.elements.when.at. |
45a0 | 6c 65 61 73 74 20 6f 6e 65 0a 20 20 20 20 20 20 20 20 23 20 6f 66 20 74 68 65 20 61 64 64 72 65 | least.one.........#.of.the.addre |
45c0 | 73 73 65 73 20 69 73 20 6e 6f 74 20 69 6e 20 74 68 65 20 63 61 63 68 65 20 6f 72 20 69 74 20 68 | sses.is.not.in.the.cache.or.it.h |
45e0 | 61 73 20 65 78 70 69 72 65 64 2e 0a 0a 20 20 20 20 20 20 20 20 23 20 70 79 6c 69 6e 74 3a 20 64 | as.expired...........#.pylint:.d |
4600 | 69 73 61 62 6c 65 3d 75 6e 75 73 65 64 2d 61 72 67 75 6d 65 6e 74 0a 20 20 20 20 20 20 20 20 4c | isable=unused-argument.........L |
4620 | 4f 47 2e 69 6e 66 6f 28 5f 4c 49 28 27 46 65 74 63 68 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c | OG.info(_LI('Fetch.network.topol |
4640 | 6f 67 79 20 66 72 6f 6d 20 4f 44 4c 2e 27 29 29 0a 20 20 20 20 20 20 20 20 72 65 73 70 6f 6e 73 | ogy.from.ODL.')).........respons |
4660 | 65 20 3d 20 73 65 6c 66 2e 5f 63 6c 69 65 6e 74 2e 67 65 74 28 29 0a 20 20 20 20 20 20 20 20 72 | e.=.self._client.get().........r |
4680 | 65 73 70 6f 6e 73 65 2e 72 61 69 73 65 5f 66 6f 72 5f 73 74 61 74 75 73 28 29 0a 0a 20 20 20 20 | esponse.raise_for_status()...... |
46a0 | 20 20 20 20 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 20 3d 20 72 65 73 70 6f 6e 73 65 2e | ....network_topology.=.response. |
46c0 | 6a 73 6f 6e 28 29 0a 20 20 20 20 20 20 20 20 69 66 20 4c 4f 47 2e 69 73 45 6e 61 62 6c 65 64 46 | json().........if.LOG.isEnabledF |
46e0 | 6f 72 28 6c 6f 67 67 69 6e 67 2e 44 45 42 55 47 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 | or(logging.DEBUG):.............t |
4700 | 6f 70 6f 6c 6f 67 79 5f 73 74 72 20 3d 20 6a 73 6f 6e 75 74 69 6c 73 2e 64 75 6d 70 73 28 0a 20 | opology_str.=.jsonutils.dumps(.. |
4720 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 2c | ...............network_topology, |
4740 | 20 73 6f 72 74 5f 6b 65 79 73 3d 54 72 75 65 2c 20 69 6e 64 65 6e 74 3d 34 2c 0a 20 20 20 20 20 | .sort_keys=True,.indent=4,...... |
4760 | 20 20 20 20 20 20 20 20 20 20 20 73 65 70 61 72 61 74 6f 72 73 3d 28 27 2c 27 2c 20 27 3a 20 27 | ...........separators=(',',.':.' |
4780 | 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 62 75 67 28 22 47 6f 74 20 6e 65 | )).............LOG.debug("Got.ne |
47a0 | 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 3a 5c 6e 25 73 22 2c 20 74 6f 70 6f 6c 6f 67 79 5f 73 | twork.topology:\n%s",.topology_s |
47c0 | 74 72 29 0a 0a 20 20 20 20 20 20 20 20 61 74 5f 6c 65 61 73 74 5f 6f 6e 65 5f 65 6c 65 6d 65 6e | tr)..........at_least_one_elemen |
47e0 | 74 5f 66 6f 72 5f 61 73 6b 65 64 5f 61 64 64 72 65 73 73 65 73 20 3d 20 46 61 6c 73 65 0a 20 20 | t_for_asked_addresses.=.False... |
4800 | 20 20 20 20 20 20 66 6f 72 20 70 61 72 73 65 72 20 69 6e 20 73 65 6c 66 2e 5f 70 61 72 73 65 72 | ......for.parser.in.self._parser |
4820 | 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 | s:.............try:............. |
4840 | 20 20 20 20 66 6f 72 20 65 6c 65 6d 65 6e 74 20 69 6e 20 70 61 72 73 65 72 2e 70 61 72 73 65 5f | ....for.element.in.parser.parse_ |
4860 | 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 28 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 | network_topology(network_topolog |
4880 | 79 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 6e 6f 74 20 69 | y):.....................if.not.i |
48a0 | 73 69 6e 73 74 61 6e 63 65 28 65 6c 65 6d 65 6e 74 2c 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f | sinstance(element,.NetworkTopolo |
48c0 | 67 79 45 6c 65 6d 65 6e 74 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | gyElement):..................... |
48e0 | 20 20 20 20 72 61 69 73 65 20 54 79 70 65 45 72 72 6f 72 28 0a 20 20 20 20 20 20 20 20 20 20 20 | ....raise.TypeError(............ |
4900 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 59 69 65 6c 64 20 65 6c 65 6d 65 6e 74 20 | ................."Yield.element. |
4920 | 64 6f 65 73 6e 27 74 20 69 6d 70 6c 65 6d 65 6e 74 20 69 6e 74 65 72 66 61 63 65 20 22 0a 20 20 | doesn't.implement.interface."... |
4940 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 27 4e 65 74 77 | .........................."'Netw |
4960 | 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 27 3a 20 7b 21 72 7d 22 2e 66 6f 72 6d 61 | orkTopologyElement':.{!r}".forma |
4980 | 74 28 65 6c 65 6d 65 6e 74 29 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | t(element))..................... |
49a0 | 23 20 74 68 65 20 73 61 6d 65 20 65 6c 65 6d 65 6e 74 20 63 61 6e 20 62 65 20 6b 6e 6f 77 6e 20 | #.the.same.element.can.be.known. |
49c0 | 62 79 20 6d 6f 72 65 20 68 6f 73 74 20 61 64 64 72 65 73 73 65 73 0a 20 20 20 20 20 20 20 20 20 | by.more.host.addresses.......... |
49e0 | 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 68 6f 73 74 5f 61 64 64 72 65 73 73 20 69 6e 20 65 | ...........for.host_address.in.e |
4a00 | 6c 65 6d 65 6e 74 2e 68 6f 73 74 5f 61 64 64 72 65 73 73 65 73 3a 0a 20 20 20 20 20 20 20 20 20 | lement.host_addresses:.......... |
4a20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 68 6f 73 74 5f 61 64 64 72 65 73 73 20 69 | ...............if.host_address.i |
4a40 | 6e 20 61 64 64 72 65 73 73 65 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | n.addresses:.................... |
4a60 | 20 20 20 20 20 20 20 20 20 61 74 5f 6c 65 61 73 74 5f 6f 6e 65 5f 65 6c 65 6d 65 6e 74 5f 66 6f | .........at_least_one_element_fo |
4a80 | 72 5f 61 73 6b 65 64 5f 61 64 64 72 65 73 73 65 73 20 3d 20 54 72 75 65 0a 20 20 20 20 20 20 20 | r_asked_addresses.=.True........ |
4aa0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 64 65 62 75 67 28 22 | .....................LOG.debug(" |
4ac0 | 46 6f 75 6e 64 20 48 6f 73 74 3a 20 25 73 20 69 6e 20 63 61 63 68 65 5c 6e 22 2c 20 68 6f 73 74 | Found.Host:.%s.in.cache\n",.host |
4ae0 | 5f 61 64 64 72 65 73 73 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | _address)....................... |
4b00 | 20 20 79 69 65 6c 64 20 68 6f 73 74 5f 61 64 64 72 65 73 73 2c 20 65 6c 65 6d 65 6e 74 0a 20 20 | ..yield.host_address,.element... |
4b20 | 20 20 20 20 20 20 20 20 20 20 65 78 63 65 70 74 20 45 78 63 65 70 74 69 6f 6e 3a 0a 20 20 20 20 | ..........except.Exception:..... |
4b40 | 20 20 20 20 20 20 20 20 20 20 20 20 4c 4f 47 2e 65 78 63 65 70 74 69 6f 6e 28 0a 20 20 20 20 20 | ............LOG.exception(...... |
4b60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5f 4c 45 28 22 50 61 72 73 65 72 20 25 28 70 61 72 | ..............._LE("Parser.%(par |
4b80 | 73 65 72 29 72 20 66 61 69 6c 65 64 20 74 6f 20 70 61 72 73 65 20 6e 65 74 77 6f 72 6b 20 74 6f | ser)r.failed.to.parse.network.to |
4ba0 | 70 6f 6c 6f 67 79 2e 22 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7b | pology."),.....................{ |
4bc0 | 27 70 61 72 73 65 72 27 3a 20 70 61 72 73 65 72 7d 29 0a 0a 20 20 20 20 20 20 20 20 69 66 20 6e | 'parser':.parser})..........if.n |
4be0 | 6f 74 20 61 74 5f 6c 65 61 73 74 5f 6f 6e 65 5f 65 6c 65 6d 65 6e 74 5f 66 6f 72 5f 61 73 6b 65 | ot.at_least_one_element_for_aske |
4c00 | 64 5f 61 64 64 72 65 73 73 65 73 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 74 68 69 73 20 | d_addresses:.............#.this. |
4c20 | 77 69 6c 6c 20 6d 61 72 6b 20 65 6e 74 72 69 65 73 20 66 6f 72 20 67 69 76 65 6e 20 61 64 64 72 | will.mark.entries.for.given.addr |
4c40 | 65 73 73 65 73 20 61 73 20 66 61 69 6c 65 64 20 74 6f 20 61 6c 6c 6f 77 0a 20 20 20 20 20 20 20 | esses.as.failed.to.allow........ |
4c60 | 20 20 20 20 20 23 20 63 61 6c 6c 69 6e 67 20 74 68 69 73 20 6d 65 74 68 6f 64 20 61 67 61 69 6e | .....#.calling.this.method.again |
4c80 | 20 61 73 20 73 6f 6f 6e 20 69 74 20 69 73 20 72 65 71 75 65 73 74 65 64 20 61 6e 64 20 61 76 6f | .as.soon.it.is.requested.and.avo |
4ca0 | 69 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 77 61 69 74 69 6e 67 20 66 6f 72 20 63 61 63 | id.............#.waiting.for.cac |
4cc0 | 68 65 20 65 78 70 69 72 61 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 61 69 73 65 20 | he.expiration.............raise. |
4ce0 | 56 61 6c 75 65 45 72 72 6f 72 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 4e 6f 20 | ValueError(.................'No. |
4d00 | 73 75 63 68 20 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 20 66 6f 72 20 67 69 76 65 6e 20 | such.topology.element.for.given. |
4d20 | 68 6f 73 74 20 61 64 64 72 65 73 73 65 73 3a 20 7b 7d 27 2e 66 6f 72 6d 61 74 28 0a 20 20 20 20 | host.addresses:.{}'.format(..... |
4d40 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 2c 20 27 2e 6a 6f 69 6e 28 61 64 64 72 65 73 | ................',.'.join(addres |
4d60 | 73 65 73 29 29 29 0a 0a 0a 40 73 69 78 2e 61 64 64 5f 6d 65 74 61 63 6c 61 73 73 28 61 62 63 2e | ses)))...@six.add_metaclass(abc. |
4d80 | 41 42 43 4d 65 74 61 29 0a 63 6c 61 73 73 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 | ABCMeta).class.NetworkTopologyPa |
4da0 | 72 73 65 72 28 6f 62 6a 65 63 74 29 3a 0a 0a 20 20 20 20 40 63 6c 61 73 73 6d 65 74 68 6f 64 0a | rser(object):......@classmethod. |
4dc0 | 20 20 20 20 64 65 66 20 63 72 65 61 74 65 5f 70 61 72 73 65 72 28 63 6c 73 2c 20 70 61 72 73 65 | ....def.create_parser(cls,.parse |
4de0 | 72 5f 63 6c 61 73 73 5f 6e 61 6d 65 29 3a 0a 20 20 20 20 20 20 20 20 27 27 27 43 72 65 61 74 65 | r_class_name):.........'''Create |
4e00 | 73 20 61 20 27 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 27 20 6f 66 20 67 | s.a.'NetworkTopologyParser'.of.g |
4e20 | 69 76 65 6e 20 63 6c 61 73 73 20 6e 61 6d 65 2e 0a 0a 20 20 20 20 20 20 20 20 27 27 27 0a 20 20 | iven.class.name...........'''... |
4e40 | 20 20 20 20 20 20 6d 6f 64 75 6c 65 5f 6e 61 6d 65 2c 20 63 6c 61 73 73 5f 6e 61 6d 65 20 3d 20 | ......module_name,.class_name.=. |
4e60 | 70 61 72 73 65 72 5f 63 6c 61 73 73 5f 6e 61 6d 65 2e 72 73 70 6c 69 74 28 27 2e 27 2c 20 31 29 | parser_class_name.rsplit('.',.1) |
4e80 | 0a 20 20 20 20 20 20 20 20 6d 6f 64 75 6c 65 20 3d 20 69 6d 70 6f 72 74 6c 69 62 2e 69 6d 70 6f | .........module.=.importlib.impo |
4ea0 | 72 74 5f 6d 6f 64 75 6c 65 28 6d 6f 64 75 6c 65 5f 6e 61 6d 65 29 0a 20 20 20 20 20 20 20 20 63 | rt_module(module_name).........c |
4ec0 | 6c 73 73 20 3d 20 67 65 74 61 74 74 72 28 6d 6f 64 75 6c 65 2c 20 63 6c 61 73 73 5f 6e 61 6d 65 | lss.=.getattr(module,.class_name |
4ee0 | 29 0a 20 20 20 20 20 20 20 20 69 66 20 6e 6f 74 20 69 73 73 75 62 63 6c 61 73 73 28 63 6c 73 73 | ).........if.not.issubclass(clss |
4f00 | 2c 20 63 6c 73 29 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 61 69 73 65 20 54 79 70 65 45 72 | ,.cls):.............raise.TypeEr |
4f20 | 72 6f 72 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 43 6c 61 73 73 20 7b 63 6c 61 | ror(................."Class.{cla |
4f40 | 73 73 5f 6e 61 6d 65 21 72 7d 20 6f 66 20 6d 6f 64 75 6c 65 20 7b 6d 6f 64 75 6c 65 5f 6e 61 6d | ss_name!r}.of.module.{module_nam |
4f60 | 65 21 72 7d 20 64 6f 65 73 6e 27 74 20 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 | e!r}.doesn't."................." |
4f80 | 69 6d 70 6c 65 6d 65 6e 74 20 27 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 50 61 72 73 65 72 | implement.'NetworkTopologyParser |
4fa0 | 27 20 69 6e 74 65 72 66 61 63 65 2e 22 2e 66 6f 72 6d 61 74 28 0a 20 20 20 20 20 20 20 20 20 20 | '.interface.".format(........... |
4fc0 | 20 20 20 20 20 20 20 20 20 20 63 6c 61 73 73 5f 6e 61 6d 65 3d 63 6c 61 73 73 5f 6e 61 6d 65 2c | ..........class_name=class_name, |
4fe0 | 20 6d 6f 64 75 6c 65 5f 6e 61 6d 65 3d 6d 6f 64 75 6c 65 5f 6e 61 6d 65 29 29 0a 20 20 20 20 20 | .module_name=module_name))...... |
5000 | 20 20 20 72 65 74 75 72 6e 20 63 6c 73 73 28 29 0a 0a 20 20 20 20 40 61 62 63 2e 61 62 73 74 72 | ...return.clss()......@abc.abstr |
5020 | 61 63 74 6d 65 74 68 6f 64 0a 20 20 20 20 64 65 66 20 70 61 72 73 65 5f 6e 65 74 77 6f 72 6b 5f | actmethod.....def.parse_network_ |
5040 | 74 6f 70 6f 6c 6f 67 79 28 73 65 6c 66 2c 20 6e 65 74 77 6f 72 6b 5f 74 6f 70 6f 6c 6f 67 79 29 | topology(self,.network_topology) |
5060 | 3a 0a 20 20 20 20 20 20 20 20 27 27 27 50 61 72 73 65 73 20 4f 70 65 6e 44 61 79 6c 69 67 68 74 | :.........'''Parses.OpenDaylight |
5080 | 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 0a 0a 20 20 20 20 20 20 20 20 59 69 65 6c 64 | .network.topology..........Yield |
50a0 | 73 20 61 6c 6c 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 20 65 6c 65 6d 65 6e 74 73 20 | s.all.network.topology.elements. |
50c0 | 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 0a 20 20 20 20 20 20 20 20 27 4e 65 74 77 6f 72 6b 54 6f 70 | implementing.........'NetworkTop |
50e0 | 6f 6c 6f 67 79 45 6c 65 6d 65 6e 74 27 20 69 6e 74 65 72 66 61 63 65 20 66 6f 75 6e 64 20 69 6e | ologyElement'.interface.found.in |
5100 | 20 67 69 76 65 6e 20 6e 65 74 77 6f 72 6b 20 74 6f 70 6f 6c 6f 67 79 2e 0a 20 20 20 20 20 20 20 | .given.network.topology......... |
5120 | 20 27 27 27 0a 0a 0a 40 73 69 78 2e 61 64 64 5f 6d 65 74 61 63 6c 61 73 73 28 61 62 63 2e 41 42 | .'''...@six.add_metaclass(abc.AB |
5140 | 43 4d 65 74 61 29 0a 63 6c 61 73 73 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 45 6c 65 6d | CMeta).class.NetworkTopologyElem |
5160 | 65 6e 74 28 6f 62 6a 65 63 74 29 3a 0a 0a 20 20 20 20 40 61 62 63 2e 61 62 73 74 72 61 63 74 70 | ent(object):......@abc.abstractp |
5180 | 72 6f 70 65 72 74 79 0a 20 20 20 20 64 65 66 20 68 6f 73 74 5f 61 64 64 72 65 73 73 65 73 28 73 | roperty.....def.host_addresses(s |
51a0 | 65 6c 66 29 3a 0a 20 20 20 20 20 20 20 20 27 27 27 4c 69 73 74 20 6f 66 20 6b 6e 6f 77 6e 20 68 | elf):.........'''List.of.known.h |
51c0 | 6f 73 74 20 61 64 64 72 65 73 73 65 73 20 6f 66 20 61 20 73 69 6e 67 6c 65 20 63 6f 6d 70 75 74 | ost.addresses.of.a.single.comput |
51e0 | 65 20 68 6f 73 74 0a 0a 20 20 20 20 20 20 20 20 45 69 74 68 65 72 20 68 6f 73 74 20 6e 61 6d 65 | e.host..........Either.host.name |
5200 | 73 20 61 6e 64 20 69 70 20 61 64 64 72 65 73 73 65 73 20 61 72 65 20 76 61 6c 69 64 2e 0a 20 20 | s.and.ip.addresses.are.valid.... |
5220 | 20 20 20 20 20 20 4e 65 75 74 72 6f 6e 20 68 6f 73 74 20 63 6f 6e 74 72 6f 6c 6c 65 72 20 6d 75 | ......Neutron.host.controller.mu |
5240 | 73 74 20 6b 6e 6f 77 20 61 74 20 6c 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 73 65 20 63 6f | st.know.at.least.one.of.these.co |
5260 | 6d 70 75 74 65 20 68 6f 73 74 0a 20 20 20 20 20 20 20 20 6e 61 6d 65 73 20 6f 72 20 69 70 20 61 | mpute.host.........names.or.ip.a |
5280 | 64 64 72 65 73 73 65 73 20 74 6f 20 66 69 6e 64 20 74 68 69 73 20 65 6c 65 6d 65 6e 74 2e 0a 20 | ddresses.to.find.this.element... |
52a0 | 20 20 20 20 20 20 20 27 27 27 0a 0a 20 20 20 20 40 61 62 63 2e 61 62 73 74 72 61 63 74 70 72 6f | .......'''......@abc.abstractpro |
52c0 | 70 65 72 74 79 0a 20 20 20 20 64 65 66 20 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 28 73 65 | perty.....def.valid_vif_types(se |
52e0 | 6c 66 29 3a 0a 20 20 20 20 20 20 20 20 27 27 27 52 65 74 75 72 6e 73 20 61 20 74 75 70 6c 65 20 | lf):.........'''Returns.a.tuple. |
5300 | 6c 69 73 74 69 6e 67 20 56 49 46 20 74 79 70 65 73 20 73 75 70 70 6f 72 74 65 64 20 62 79 20 74 | listing.VIF.types.supported.by.t |
5320 | 68 65 20 63 6f 6d 70 75 74 65 20 6e 6f 64 65 0a 0a 20 20 20 20 20 20 20 20 27 27 27 0a 0a 20 20 | he.compute.node..........'''.... |
5340 | 20 20 40 61 62 63 2e 61 62 73 74 72 61 63 74 6d 65 74 68 6f 64 0a 20 20 20 20 64 65 66 20 62 69 | ..@abc.abstractmethod.....def.bi |
5360 | 6e 64 5f 70 6f 72 74 28 73 65 6c 66 2c 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2c 20 76 69 66 5f | nd_port(self,.port_context,.vif_ |
5380 | 74 79 70 65 2c 20 76 69 66 5f 64 65 74 61 69 6c 73 29 3a 0a 20 20 20 20 20 20 20 20 27 27 27 42 | type,.vif_details):.........'''B |
53a0 | 69 6e 64 20 70 6f 72 74 20 63 6f 6e 74 65 78 74 20 75 73 69 6e 67 20 67 69 76 65 6e 20 76 69 66 | ind.port.context.using.given.vif |
53c0 | 20 74 79 70 65 20 61 6e 64 20 76 69 66 20 64 65 74 61 69 6c 73 0a 0a 20 20 20 20 20 20 20 20 54 | .type.and.vif.details..........T |
53e0 | 68 69 73 20 6d 65 74 68 6f 64 20 69 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 73 65 61 72 63 68 | his.method.is.expected.to.search |
5400 | 20 66 6f 72 20 61 20 76 61 6c 69 64 20 73 65 67 6d 65 6e 74 20 61 6e 64 20 74 68 65 6e 0a 20 20 | .for.a.valid.segment.and.then... |
5420 | 20 20 20 20 20 20 63 61 6c 6c 20 70 6f 72 74 5f 63 6f 6e 74 65 78 74 2e 73 65 74 5f 62 69 6e 64 | ......call.port_context.set_bind |
5440 | 69 6e 67 28 29 0a 20 20 20 20 20 20 20 20 27 27 27 0a 0a 20 20 20 20 64 65 66 20 74 6f 5f 64 69 | ing().........'''......def.to_di |
5460 | 63 74 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 20 20 63 6c 73 20 3d 20 74 79 70 65 28 73 65 6c | ct(self):.........cls.=.type(sel |
5480 | 66 29 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | f).........return.{............. |
54a0 | 27 63 6c 61 73 73 27 3a 20 63 6c 73 2e 5f 5f 6d 6f 64 75 6c 65 5f 5f 20 2b 20 27 2e 27 20 2b 20 | 'class':.cls.__module__.+.'.'.+. |
54c0 | 63 6c 73 2e 5f 5f 6e 61 6d 65 5f 5f 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 27 68 6f 73 74 5f | cls.__name__,.............'host_ |
54e0 | 61 64 64 72 65 73 73 65 73 27 3a 20 6c 69 73 74 28 73 65 6c 66 2e 68 6f 73 74 5f 61 64 64 72 65 | addresses':.list(self.host_addre |
5500 | 73 73 65 73 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 27 76 61 6c 69 64 5f 76 69 66 5f 74 79 | sses),.............'valid_vif_ty |
5520 | 70 65 73 27 3a 20 6c 69 73 74 28 73 65 6c 66 2e 76 61 6c 69 64 5f 76 69 66 5f 74 79 70 65 73 29 | pes':.list(self.valid_vif_types) |
5540 | 7d 0a 0a 20 20 20 20 64 65 66 20 74 6f 5f 6a 73 6f 6e 28 73 65 6c 66 29 3a 0a 20 20 20 20 20 20 | }......def.to_json(self):....... |
5560 | 20 20 72 65 74 75 72 6e 20 6a 73 6f 6e 75 74 69 6c 73 2e 64 75 6d 70 73 28 0a 20 20 20 20 20 20 | ..return.jsonutils.dumps(....... |
5580 | 20 20 20 20 20 20 73 65 6c 66 2e 74 6f 5f 64 69 63 74 28 29 2c 20 73 6f 72 74 5f 6b 65 79 73 3d | ......self.to_dict(),.sort_keys= |
55a0 | 54 72 75 65 2c 20 69 6e 64 65 6e 74 3d 34 2c 20 73 65 70 61 72 61 74 6f 72 73 3d 28 27 2c 27 2c | True,.indent=4,.separators=(',', |
55c0 | 20 27 3a 20 27 29 29 0a 0a 0a 63 6c 61 73 73 20 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 43 | .':.'))...class.NetworkTopologyC |
55e0 | 6c 69 65 6e 74 28 63 6c 69 65 6e 74 2e 4f 70 65 6e 44 61 79 6c 69 67 68 74 52 65 73 74 43 6c 69 | lient(client.OpenDaylightRestCli |
5600 | 65 6e 74 29 3a 0a 0a 20 20 20 20 5f 47 45 54 5f 4f 44 4c 5f 4e 45 54 57 4f 52 4b 5f 54 4f 50 4f | ent):......_GET_ODL_NETWORK_TOPO |
5620 | 4c 4f 47 59 5f 55 52 4c 20 3d 5c 0a 20 20 20 20 20 20 20 20 27 72 65 73 74 63 6f 6e 66 2f 6f 70 | LOGY_URL.=\.........'restconf/op |
5640 | 65 72 61 74 69 6f 6e 61 6c 2f 6e 65 74 77 6f 72 6b 2d 74 6f 70 6f 6c 6f 67 79 3a 6e 65 74 77 6f | erational/network-topology:netwo |
5660 | 72 6b 2d 74 6f 70 6f 6c 6f 67 79 27 0a 0a 20 20 20 20 64 65 66 20 5f 5f 69 6e 69 74 5f 5f 28 73 | rk-topology'......def.__init__(s |
5680 | 65 6c 66 2c 20 75 72 6c 2c 20 75 73 65 72 6e 61 6d 65 2c 20 70 61 73 73 77 6f 72 64 2c 20 74 69 | elf,.url,.username,.password,.ti |
56a0 | 6d 65 6f 75 74 29 3a 0a 20 20 20 20 20 20 20 20 69 66 20 75 72 6c 3a 0a 20 20 20 20 20 20 20 20 | meout):.........if.url:......... |
56c0 | 20 20 20 20 75 72 6c 20 3d 20 70 61 72 73 65 2e 75 72 6c 70 61 72 73 65 28 75 72 6c 29 0a 20 20 | ....url.=.parse.urlparse(url)... |
56e0 | 20 20 20 20 20 20 20 20 20 20 70 6f 72 74 20 3d 20 27 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ..........port.=.''............. |
5700 | 69 66 20 75 72 6c 2e 70 6f 72 74 3a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 6f 72 | if.url.port:.................por |
5720 | 74 20 3d 20 27 3a 27 20 2b 20 73 74 72 28 75 72 6c 2e 70 6f 72 74 29 0a 20 20 20 20 20 20 20 20 | t.=.':'.+.str(url.port)......... |
5740 | 20 20 20 20 74 6f 70 6f 6c 6f 67 79 5f 75 72 6c 20 3d 20 27 7b 7d 3a 2f 2f 7b 7d 7b 7d 2f 7b 7d | ....topology_url.=.'{}://{}{}/{} |
5760 | 27 2e 66 6f 72 6d 61 74 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 75 72 6c 2e 73 63 | '.format(.................url.sc |
5780 | 68 65 6d 65 2c 20 75 72 6c 2e 68 6f 73 74 6e 61 6d 65 2c 20 70 6f 72 74 2c 0a 20 20 20 20 20 20 | heme,.url.hostname,.port,....... |
57a0 | 20 20 20 20 20 20 20 20 20 20 73 65 6c 66 2e 5f 47 45 54 5f 4f 44 4c 5f 4e 45 54 57 4f 52 4b 5f | ..........self._GET_ODL_NETWORK_ |
57c0 | 54 4f 50 4f 4c 4f 47 59 5f 55 52 4c 29 0a 20 20 20 20 20 20 20 20 65 6c 73 65 3a 0a 20 20 20 20 | TOPOLOGY_URL).........else:..... |
57e0 | 20 20 20 20 20 20 20 20 74 6f 70 6f 6c 6f 67 79 5f 75 72 6c 20 3d 20 4e 6f 6e 65 0a 20 20 20 20 | ........topology_url.=.None..... |
5800 | 20 20 20 20 73 75 70 65 72 28 4e 65 74 77 6f 72 6b 54 6f 70 6f 6c 6f 67 79 43 6c 69 65 6e 74 2c | ....super(NetworkTopologyClient, |
5820 | 20 73 65 6c 66 29 2e 5f 5f 69 6e 69 74 5f 5f 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 6f 70 | .self).__init__(.............top |
5840 | 6f 6c 6f 67 79 5f 75 72 6c 2c 20 75 73 65 72 6e 61 6d 65 2c 20 70 61 73 73 77 6f 72 64 2c 20 74 | ology_url,.username,.password,.t |
5860 | 69 6d 65 6f 75 74 29 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | imeout)......................... |
5880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
58a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
58c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
58e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
59a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
59c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
59e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5a00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5a20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5a60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5a80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5c00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5c20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5c40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5c60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5c80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5ca0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5cc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5ce0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5d00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5d20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5d40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5d60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5d80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5da0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5dc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5de0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |