topologygenerator 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/providers/apis/onos_topology_provider.rb +5 -2
- data/lib/topologygenerator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3642b44deb79a94c72918bc4a9be2eca3f0c66d3
|
4
|
+
data.tar.gz: 7c2627e9da38dea0c8e84739db18989feb2b633b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d482ecba0cdfffda24e1494b60a15d58f91cf54e18caa813c9b949342a7f77dbfe6ea1c04e2e86d67acb7315f98823511894c9900d0c40165cede4d4fba85c57
|
7
|
+
data.tar.gz: 73f462db61ac91b9ef8eab054de65c2ee5a60bd637590ad8ffc581796617b15ce9f0758571e990dbee6cbbda6f5ca27d391b2abff47fa9c580876e227e732fed
|
@@ -132,9 +132,12 @@ links_between_routers_info is an array of elements of this kind
|
|
132
132
|
raise Exception, "Destination must be either from class Router or class Host to ask for a path" unless [Host, Router].include? destination.class
|
133
133
|
|
134
134
|
paths_response = get_from_api "paths/#{CGI.escape(source.id)}/#{CGI.escape(destination.id)}"
|
135
|
-
|
136
|
-
|
135
|
+
paths_info = (JSON.parse paths_response.body)['paths']
|
137
136
|
path = Path.new(source,destination)
|
137
|
+
|
138
|
+
return path if paths_info.size == 0
|
139
|
+
|
140
|
+
links_info = paths_info.first['links']
|
138
141
|
|
139
142
|
#If either the source or the destination are hosts, the path will return host instead of device
|
140
143
|
first_link = links_info.shift
|