vagrant-routes 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/command.rb +7 -0
- data/vagrant-routes.gemspec +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: fade2dd157a089035a96ab83b2b2c2a4b7df6a24
|
4
|
+
data.tar.gz: 20cb04d4c044a199788a4dc814e151b14a364771
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7df50e617ca88a876e412f846f4558ffbb9fd1e103332ed26b4f787df1536faf752a2dd253eb130b551d5b8341c3149d877b43f6ea47fc628a64a0f725d9ccd
|
7
|
+
data.tar.gz: 9ee21443eae9277e1e3b7f4ce3ab6c176fd9ad4c843fa53fd0b6df6c5fafd8cf42853cc6183c8c61e8a6a8c25f350d8fc9b688ad5b41b791c54df40feea34b7e
|
data/lib/command.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module Routes
|
3
|
+
# Issue when `oc get routes` returns empty responce
|
4
|
+
class NoRoutesError < StandardError; end
|
5
|
+
|
3
6
|
class Command < Vagrant.plugin(2, :command)
|
4
7
|
def self.synopsis
|
5
8
|
'Access OpenShift routes from the host'
|
@@ -14,6 +17,8 @@ module VagrantPlugins
|
|
14
17
|
ip = machine.ssh_info[:host]
|
15
18
|
update_hosts(routes_hostnames(@result), ip)
|
16
19
|
end
|
20
|
+
rescue NoRoutesError
|
21
|
+
@env.ui.error('No routes are defined.')
|
17
22
|
rescue
|
18
23
|
case @result
|
19
24
|
# We are not signed-in
|
@@ -68,11 +73,13 @@ module VagrantPlugins
|
|
68
73
|
# ruby20 ruby20-ruby-app.router.default.svc.cluster.local ruby20 app=ruby20
|
69
74
|
# pyapp pyapp-python.router.default.svc.cluster.local pyapp app=pyapp
|
70
75
|
def routes_hostnames(output)
|
76
|
+
fail NoRoutesError unless output
|
71
77
|
lines = output.split("\n")[1..-1]
|
72
78
|
hostnames = []
|
73
79
|
lines.each do |line|
|
74
80
|
hostnames << line.split[1]
|
75
81
|
end
|
82
|
+
fail NoRoutesError if hostnames.empty?
|
76
83
|
hostnames
|
77
84
|
end
|
78
85
|
|
data/vagrant-routes.gemspec
CHANGED