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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d033cfb843077337d60b2723a9042b012a2f459
4
- data.tar.gz: 2da6c15d60f399dbb4ddd5e0a736624058fff29d
3
+ metadata.gz: fade2dd157a089035a96ab83b2b2c2a4b7df6a24
4
+ data.tar.gz: 20cb04d4c044a199788a4dc814e151b14a364771
5
5
  SHA512:
6
- metadata.gz: 3cf0b3b96c9c1434d8dfb7be314b4713adb28a9de44785c2128d9a93188709c80a1f1522328d8c1b9aa11f0baf11c4bdeb351b4e5c9c6d7c22224899fc49b3d4
7
- data.tar.gz: 4fee622d043e5fdb4f7a79c09bdfc42a58eb30071a65193a56a4acc68d9944d5387e9b923428382c0dce789119d6cb09d7013bb560a73f3fcec99091ab6f76d3
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
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'vagrant-routes'
3
- spec.version = '0.0.2'
3
+ spec.version = '0.0.3'
4
4
  spec.homepage = 'https://github.com/strzibny/vagrant-routes'
5
5
  spec.summary = 'Access OpenShift routes on the host'
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Strzibny