topologygenerator 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c14cfc4d918c4a4e9aae2683623a89e98e227c4b
4
- data.tar.gz: 241afa8ebd80b6f7aa2a97c7e20ff03de8459890
3
+ metadata.gz: 3642b44deb79a94c72918bc4a9be2eca3f0c66d3
4
+ data.tar.gz: 7c2627e9da38dea0c8e84739db18989feb2b633b
5
5
  SHA512:
6
- metadata.gz: b7479989a45917148091729ee1215ee867671ae789b6b959b81986c6c1500393848fafb3035b7af88017e0fdd8c346831af72ecb0961f0cf0c86a674d9a7a181
7
- data.tar.gz: ddecd4140dcc9fa30f021a7edcc7e16859c8a25b813a3539921991a1a081ed4f67eb49a4898be8ad408f0da209d66a5443740c1024fcb668581df8848700cc21
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
- links_info = (JSON.parse paths_response.body)['paths'].first['links']
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
@@ -1,3 +1,3 @@
1
1
  class Topologygenerator
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topologygenerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrés Laurito