vagrant-rimu 0.0.3 → 0.0.4

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: 7bb71155b1d915e134acd0b54427600466968a24
4
- data.tar.gz: 92fea11036f014aa61159e4c5f5e56c359835d9a
3
+ metadata.gz: d840a350e4933f16c609939b0e47a667fb231e52
4
+ data.tar.gz: 2d6683d767c52a49ce99ef1a8e037ff7fcf568e5
5
5
  SHA512:
6
- metadata.gz: 45df36e60c52b926b9885d6df23764ae3fd33cb43a1bd99c56562327229d70180afd361bcae4aa77bd88f2025bbb9b93a4081326ad769f43fc7d0c426cf8d48c
7
- data.tar.gz: 6f2502345025c5c978ee3cf89f42b3b20cdbddf7cf040df3fc5891e0314909934cbd84dd003ea049da267713fedfdff1762304c86f9b516bc0300e555b2b2555
6
+ metadata.gz: 073c4eee2db28a3dd9c509fbee40535b0785251f194532e3bffb7f42b6a97cc7b3b78e3669a0a96575833d5b3d02f5eb736536aa05428da303fd43dfbc987af4
7
+ data.tar.gz: b191f23da8e210fb597d9814f79b46930b4d6f1dc7779d0a9e4487acebbf399fe6dc4d88550d70266b4a4cbfa2323b53bc612979bc310b8a2ed49c3d541b4d04
data/README.md CHANGED
@@ -6,6 +6,7 @@ management of [Rimuhosting](https://www.rimuhosting.com/) VPS's.
6
6
  [![Build Status](https://travis-ci.org/akissa/vagrant-rimu.svg?branch=master)](https://travis-ci.org/akissa/vagrant-rimu)
7
7
  [![Code Climate](https://codeclimate.com/github/akissa/vagrant-rimu/badges/gpa.svg)](https://codeclimate.com/github/akissa/vagrant-rimu)
8
8
  [![Test Coverage](https://codeclimate.com/github/akissa/vagrant-rimu/badges/coverage.svg)](https://codeclimate.com/github/akissa/vagrant-rimu/coverage)
9
+ [![Gem Version](https://badge.fury.io/rb/vagrant-rimu.svg)](https://badge.fury.io/rb/vagrant-rimu)
9
10
  [![MPLv2 License](https://img.shields.io/badge/license-MPLv2-blue.svg?style=flat-square)](https://www.mozilla.org/MPL/2.0/)
10
11
 
11
12
  Current Features include:
@@ -203,10 +203,17 @@ module VagrantPlugins
203
203
  end
204
204
 
205
205
  def self.action_move
206
- new_builder.tap do |b|
207
- b.use ConfigValidate
208
- b.use ConnectToRimu
209
- b.use Move
206
+ return new_builder.tap do |builder|
207
+ builder.use ConfigValidate
208
+ builder.use ConnectToRimu
209
+ builder.use Call, IsCreated do |env, b|
210
+ case env[:machine_state]
211
+ when :active, :off
212
+ b.use Move
213
+ when :not_created
214
+ b.use MessageNotCreated
215
+ end
216
+ end
210
217
  end
211
218
  end
212
219
 
@@ -56,9 +56,16 @@ module VagrantPlugins
56
56
  if params.has_key?(:instantiation_options)
57
57
  params[:instantiation_options][:password] = root_pass
58
58
  end
59
- result = client.servers.create(params)
59
+
60
+ begin
61
+ result = client.servers.create(params)
62
+ rescue ::Rimu::RimuAPI::RimuRequestError, ::Rimu::RimuAPI::RimuResponseError => e
63
+ raise Errors::ApiError, {:stderr=>e}
64
+ end
65
+
60
66
  @machine.id = result.order_oid
61
67
  env[:ui].info I18n.t('vagrant_rimu.ip_address', {:ip => result.allocated_ips["primary_ip"]})
68
+
62
69
  switch_user = @machine.provider_config.setup?
63
70
  user = @machine.config.ssh.username
64
71
  if switch_user
@@ -72,6 +79,7 @@ module VagrantPlugins
72
79
  end
73
80
  end
74
81
  @machine.config.ssh.username = user
82
+
75
83
  @app.call(env)
76
84
  end
77
85
  # rubocop:enable Metrics/AbcSize
@@ -19,9 +19,13 @@ module VagrantPlugins
19
19
  def execute(env)
20
20
  client = env[:rimu_api]
21
21
 
22
- env[:ui].info I18n.t('vagrant_rimu.move')
22
+ env[:ui].info I18n.t('vagrant_rimu.moving')
23
23
 
24
- result = client.servers.move(@machine.id.to_i)
24
+ begin
25
+ result = client.servers.move(@machine.id.to_i)
26
+ rescue ::Rimu::RimuAPI::RimuRequestError, ::Rimu::RimuAPI::RimuResponseError => e
27
+ raise Errors::ApiError, {:stderr=>e}
28
+ end
25
29
 
26
30
  @machine.id = result.order_oid
27
31
  env[:ui].info I18n.t('vagrant_rimu.ip_address', {:ip => result.allocated_ips["primary_ip"]})
@@ -38,7 +38,11 @@ module VagrantPlugins
38
38
  params.delete(:instantiation_via_clone_options) if @machine.provider_config.vps_to_clone.nil?
39
39
  params.delete(:instantiation_options) if params.has_key?(:instantiation_via_clone_options)
40
40
 
41
- client.servers.reinstall(@machine.id.to_i, params)
41
+ begin
42
+ client.servers.reinstall(@machine.id.to_i, params)
43
+ rescue ::Rimu::RimuAPI::RimuRequestError, ::Rimu::RimuAPI::RimuResponseError => e
44
+ raise Errors::ApiError, {:stderr=>e}
45
+ end
42
46
 
43
47
  switch_user = @machine.provider_config.setup?
44
48
  user = @machine.config.ssh.username
@@ -15,7 +15,12 @@ module VagrantPlugins
15
15
  def execute(env)
16
16
  client = env[:rimu_api]
17
17
  env[:ui].info I18n.t('vagrant_rimu.reloading')
18
- client.servers.reboot(@machine.id.to_i)
18
+
19
+ begin
20
+ client.servers.reboot(@machine.id.to_i)
21
+ rescue ::Rimu::RimuAPI::RimuRequestError, ::Rimu::RimuAPI::RimuResponseError => e
22
+ raise Errors::ApiError, {:stderr=>e}
23
+ end
19
24
 
20
25
  @app.call(env)
21
26
  end
@@ -24,7 +24,7 @@ module VagrantPlugins
24
24
  rescue Errors::ApiError, SystemExit, Interrupt => e
25
25
  raise e
26
26
  rescue Exception => e
27
- puts I18n.t('vagrant_rimu.errors.global_error').red unless e.message && e.message.start_with?('Catched Error:')
27
+ puts I18n.t('vagrant_rimu.errors.global_error').red unless e.message
28
28
  raise e
29
29
  end
30
30
  # rubocop:enable Lint/RescueException
@@ -11,7 +11,7 @@ module VagrantPlugins
11
11
 
12
12
  class Root < Vagrant.plugin('2', :command)
13
13
  def self.synopsis
14
- I18n.t('vagrant_rimu.command.root_synopsis')
14
+ I18n.t('vagrant_rimu.commands.root_synopsis')
15
15
  end
16
16
 
17
17
  def initialize(argv, env)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Rimu
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -14,6 +14,8 @@ en:
14
14
  Starting the VPS...
15
15
  stopping: |-
16
16
  Stopping the VPS...
17
+ moving: |-
18
+ Moving the VPS to different host...
17
19
  terminating: |-
18
20
  Terminating the VPS...
19
21
  waiting_for_ready: |-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-rimu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Colin Kissa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-29 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rimu