vagrant-redir 0.1.4 → 0.1.6

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: 774d275ebc83a433c1187a47c45b315a5e97f221
4
- data.tar.gz: 11f16637d6585bef42b4f48b2882fc792b5cef4d
3
+ metadata.gz: a2becea09021a71379108868e15ca0be1c1f4cc6
4
+ data.tar.gz: 46c4760db67a7d78e64bbff7a82a0e59757e29d2
5
5
  SHA512:
6
- metadata.gz: 30fc6e3f545f12648391296ada2b20052be4d8d420205ea42516cee0170260c3be92c6691e93aba751633483acc81484020f3b276cd4519f96ed5cb157da9e50
7
- data.tar.gz: 76529009fc6c5b33eced66d8dee83981391f1fd2144c9fed7ae868626c5a4583ecd5495209a477bfb40c1971a37f7fb91b7b8406dc366975dce63e49addc00bb
6
+ metadata.gz: a9a7a23032cface706e2fc2cdb04d675c2e1bf4643dcfb49dc29fc54c05eda4e30692cc47eecd7610bf1c1e4c2fe36e007c311a3c8465c3dafc8bc6daf909997
7
+ data.tar.gz: 145e5cf28885998a9305a782805bb0f9306b78a6b84c3cb68d1f7032f2630755d29eabae81be8abedb3d48f425ded1a9c888006fe2bb3a186848933429829a90
data/README.md CHANGED
@@ -35,7 +35,7 @@ $ vagrant redir <subcommand> -h
35
35
 
36
36
  ### addr
37
37
 
38
- Shows a list of VM's ID, name and public IP
38
+ Shows a list of running VM's ID, name and public IP (or 'NONE' value if not set).
39
39
 
40
40
  ```shell
41
41
  $ vagrant redir addr
@@ -44,7 +44,7 @@ $ vagrant redir addr
44
44
  will show:
45
45
 
46
46
  ```shell
47
- List of VM(s) public IP addresses:
47
+ List of running VM(s) public IP addresses:
48
48
  id: xdg_1506653541513_93050; name: xdg; ip: 10.0.3.173
49
49
  id: db1_1506915461158_4146; name: db1; ip: 10.0.3.55
50
50
  ```
@@ -22,22 +22,24 @@ module Vagrant
22
22
  opts = OptionParser.new
23
23
  argv = parse_options(opts)
24
24
  @logger.debug("argv: #{argv}")
25
-
26
- if with_target_vms(argv) { }.count > 0
27
- @env.ui.info I18n.t("vagrant_redir.command.addr.list_title")
28
- with_target_vms(argv) do |vm|
29
-
30
- pub_ip = vm.provider.capability(:public_address)
31
-
32
- if vm.state.id != :running
33
- raise ::Vagrant::Redir::Errors::NotRunning
34
- end
35
- if pub_ip == nil
36
- raise ::Vagrant::Redir::Errors::Unknown
37
- end
38
25
 
26
+ rc = 0
27
+ with_target_vms(argv) do |vm|
28
+ if vm.state.id != :running
29
+ #raise ::Vagrant::Redir::Errors::NotRunning
30
+ next
31
+ else
32
+ rc += 1
33
+ end
34
+
35
+ @env.ui.info I18n.t("vagrant_redir.command.addr.list_title") if rc == 1
36
+ pub_ip = vm.provider.capability(:public_address)
37
+
38
+ if pub_ip == nil
39
+ #raise ::Vagrant::Redir::Errors::Unknown
40
+ @env.ui.info I18n.t("vagrant_redir.command.addr.list_item_no_pub_ip", id: vm.id, name: vm.name)
41
+ else
39
42
  @env.ui.info I18n.t("vagrant_redir.command.addr.list_item", id: vm.id, name: vm.name, ip: pub_ip)
40
-
41
43
  end
42
44
  end
43
45
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Redir
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -1,9 +1,13 @@
1
1
  en:
2
2
  vagrant_redir:
3
+ errors:
4
+ not_running: "The VM is not running"
5
+ unknown: "Unknown error"
3
6
  command:
4
7
  addr:
5
- list_title: "List of VM(s) public IP addresses:"
8
+ list_title: "List of running VM(s) public IP addresses:"
6
9
  list_item: " id: %{id}; name: %{name}; ip: %{ip}"
10
+ list_item_no_pub_ip: " id: %{id}; name: %{name}; ip: NONE"
7
11
  config:
8
12
  list_title: "Port forwarding configuration for VM '%{name}':"
9
13
  down:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-redir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - st02tkh