vagrant-service-manager 1.3.0 → 1.3.1

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: b1481c0b9ea6e3df13c4ca4cb57a2a2303bc614e
4
- data.tar.gz: a961c8cf041ef5a7a55b58dddfda6cdcce3f5303
3
+ metadata.gz: 54c81b4b64ff2de2506fa8fc9436a50655edea16
4
+ data.tar.gz: 06822f05ffd1fe483965fe356de9f243d5d216a2
5
5
  SHA512:
6
- metadata.gz: 104f0cad9c9359c60cac0a9046df48a125b179617a3a2bb655f76c58ca3b013f3c7cbcd98a474468794398bf827ee6acd0bf244bd6009fe67f12be9c2f4bf902
7
- data.tar.gz: 631f15089eea088d3edc235145014965348d3cc1156fb6480e8f393e30302df266047796419171bf3389a75c1c12defdf032868860df7398e8d00d6fe05c4543
6
+ metadata.gz: 995db1cf5395f6984c2fff80497b1d691ddb7aeb76b514c9bcb45b92045e6af8af848495c9732d7ca213a273db2499301d4fdd536b6662c0a79c3fd100471ae2
7
+ data.tar.gz: 45a3c8d775b2fde742fdf89c5291c6621791de45fcbdd4e27ca841b6897a6b231ed99adee3b04203475fa5648b5afb33047a559d5702095f3516a988516a63e6
data/.rubocop.yml CHANGED
@@ -4,10 +4,12 @@ AllCops:
4
4
  Exclude:
5
5
  - 'build/**/*'
6
6
 
7
- # Offense count: 57
8
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
9
- # URISchemes: http, https
10
7
  Metrics/LineLength:
11
8
  Max: 120
12
9
  Exclude:
13
10
  - 'Rakefile'
11
+
12
+ Metrics/ClassLength:
13
+ Max: 209
14
+ Exclude:
15
+ - 'lib/vagrant-service-manager/command.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.3.1 Aug 25, 2016
4
+ - Fix #257 proper error message on restarting a stopped service @budhrg
5
+ - Fix #379 Success message after vagrant up for Kubernetes @budhrg
6
+
3
7
  ## v1.3.0 Aug 12, 2016
4
8
  - Fix #374 Fix kubernetes acceptance test @budhrg
5
9
  - Fix #372 Detect already downloaded oc binary in Windows @budhrg
@@ -18,17 +18,13 @@ Feature: Command output from various OpenShift related commands in ADB
18
18
  config.vm.box_url = 'file://../../.boxes/<box>-<provider>.box'
19
19
  config.vm.network :private_network, ip: '<ip>'
20
20
  config.vm.synced_folder '.', '/vagrant', disabled: true
21
- config.servicemanager.services = 'docker, openshift'
22
21
 
23
- config.servicemanager.openshift_image_tag = 'v1.2.1'
24
- config.servicemanager.openshift_image_name = 'openshift/origin'
25
- config.servicemanager.openshift_docker_registry = 'docker.io'
22
+ config.servicemanager.services = 'docker, openshift'
26
23
  end
27
24
  """
28
25
 
29
26
  When I successfully run `bundle exec vagrant up --provider <provider>`
30
- # TODO, for some reason I can not use 'successfully' here. Seems the exit code is not 0 in this case!?
31
- And I run `bundle exec vagrant service-manager env openshift`
27
+ And I successfully run `bundle exec vagrant service-manager env openshift`
32
28
  Then stdout from "bundle exec vagrant service-manager env openshift" should be evaluable in a shell
33
29
  And stdout from "bundle exec vagrant service-manager env openshift" should contain:
34
30
  """
@@ -51,31 +47,10 @@ Feature: Command output from various OpenShift related commands in ADB
51
47
  DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
52
48
  """
53
49
 
54
- When I successfully run `bundle exec vagrant service-manager env`
55
- Then stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_HOST=tcp://<ip>:2376"
56
- And stdout from "bundle exec vagrant service-manager env" should match /export DOCKER_CERT_PATH=.*\/.vagrant\/machines\/cdk\/virtualbox\/docker/
57
- And stdout from "bundle exec vagrant service-manager env" should contain "export DOCKER_TLS_VERIFY=1"
58
- And stdout from "bundle exec vagrant service-manager env" should match /export DOCKER_API_VERSION=1.2\d/
59
- And stdout from "bundle exec vagrant service-manager env" should match /# eval "\$\(vagrant service-manager env\)"/
60
- And stdout from "bundle exec vagrant service-manager env" should contain:
61
- """
62
- # openshift env:
63
- # You can access the OpenShift console on: https://<ip>:8443/console
64
- # To use OpenShift CLI, run: oc login https://<ip>:8443
65
- export OPENSHIFT_URL=https://<ip>:8443
66
- export OPENSHIFT_WEB_CONSOLE=https://<ip>:8443/console
67
- export DOCKER_REGISTRY=hub.openshift.centos7-adb.<ip>.xip.io
68
-
69
- # run following command to configure your shell:
70
- # eval "$(vagrant service-manager env)"
71
- """
72
-
73
- When I successfully run `bundle exec vagrant up --provider <provider>`
74
- And I run `bundle exec vagrant service-manager install-cli openshift`
50
+ When I run `bundle exec vagrant service-manager install-cli openshift`
75
51
  Then the exit status should be 0
76
52
  And the binary "oc" should be installed
77
53
 
78
54
  Examples:
79
55
  | box | provider | ip |
80
56
  | adb | virtualbox | 10.10.10.42 |
81
- | adb | libvirt | 10.10.10.42 |
@@ -0,0 +1,26 @@
1
+ module VagrantPlugins
2
+ module ServiceManager
3
+ module Action
4
+ class LogConfiguredServices
5
+ def initialize(app, env)
6
+ @app = app
7
+ @machine = env[:machine]
8
+ @ui = env[:ui]
9
+ @services = @machine.config.servicemanager.services.split(',').map(&:strip)
10
+ end
11
+
12
+ def call(env)
13
+ @app.call(env)
14
+
15
+ @services.each do |service|
16
+ if !PluginUtil.service_running?(@machine, service)
17
+ @ui.info I18n.t('servicemanager.actions.service_failure', service: service.capitalize)
18
+ elsif PluginUtil.service_running?(@machine, service)
19
+ @ui.info I18n.t('servicemanager.actions.service_success', service: service.capitalize)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -24,10 +24,7 @@ module VagrantPlugins
24
24
  end
25
25
 
26
26
  def add_private_network
27
- @ui.info <<-MSG
28
- When using virtualbox, a non-NAT network interface is required.
29
- Adding a private network using DHCP
30
- MSG
27
+ @ui.info I18n.t('servicemanager.action.private_network')
31
28
  @machine.config.vm.network :private_network, type: :dhcp
32
29
  end
33
30
  end
@@ -248,6 +248,14 @@ module VagrantPlugins
248
248
  PluginUtil.generate_kubeconfig(machine, @env.ui, File.dirname(ServiceManager.bin_dir))
249
249
  end
250
250
  end
251
+ rescue StandardError => e
252
+ if operation == 'restart' && e.message.include?("Start #{service} first")
253
+ @env.ui.error I18n.t('servicemanager.commands.operation.start_service_first')
254
+ else
255
+ @env.ui.error e.message.squeeze
256
+ end
257
+
258
+ exit 126
251
259
  end
252
260
 
253
261
  def display_box_ip(script_readable = false)
@@ -21,6 +21,7 @@ module VagrantPlugins
21
21
  action_hook(:servicemanager, :machine_action_up) do |hook|
22
22
  hook.before(VagrantPlugins::ProviderVirtualBox::Action::Network, setup_network)
23
23
  hook.after(Vagrant::Action::Builtin::SyncedFolders, Service)
24
+ hook.after Vagrant::Action::Builtin::Provision, final_actions
24
25
  end
25
26
 
26
27
  def self.setup_network
@@ -28,6 +29,12 @@ module VagrantPlugins
28
29
  b.use Action::SetupNetwork
29
30
  end
30
31
  end
32
+
33
+ def self.final_actions
34
+ Vagrant::Action::Builder.new.tap do |b|
35
+ b.use Action::LogConfiguredServices
36
+ end
37
+ end
31
38
  end
32
39
  end
33
40
  end
@@ -107,8 +107,6 @@ module VagrantPlugins
107
107
  end
108
108
 
109
109
  exit_code
110
- rescue StandardError => e
111
- ui.error e.message.squeeze
112
110
  end
113
111
 
114
112
  def self.execute_once(machine, ui, command)
@@ -22,6 +22,9 @@ module VagrantPlugins
22
22
  PluginUtil.copy_certs_to_host(@machine, secrets_path, @ui)
23
23
  end
24
24
  end
25
+ rescue StandardError => e
26
+ @ui.error e.message.squeeze
27
+ exit 126
25
28
  end
26
29
 
27
30
  def status
@@ -13,6 +13,9 @@ module VagrantPlugins
13
13
  exit_code = PluginUtil.execute_and_exit_on_fail(@machine, @ui, command)
14
14
  PluginUtil.generate_kubeconfig(@machine, @ui, @plugin_dir) if exit_code.zero?
15
15
  end
16
+ rescue StandardError => e
17
+ @ui.error e.message.squeeze
18
+ exit 126
16
19
  end
17
20
 
18
21
  def status
@@ -16,6 +16,9 @@ module VagrantPlugins
16
16
  end
17
17
  rescue Vagrant::Errors::GuestCapabilityNotFound
18
18
  PluginLogger.debug('Guest capability not found while starting OpenShift service')
19
+ rescue StandardError => e
20
+ @ui.error e.message.squeeze
21
+ exit 126
19
22
  end
20
23
 
21
24
  def status
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module ServiceManager
3
- VERSION = '1.3.0'.freeze
3
+ VERSION = '1.3.1'.freeze
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -187,6 +187,7 @@ en:
187
187
  sccli_only_support: |-
188
188
  Only sccli services are supported. For example:
189
189
  docker, openshift and kubernetes
190
+ start_service_first: 'Please start the service first before restarting.'
190
191
  install_cli:
191
192
  message: |-
192
193
  # Binary %{when} available at %{path}
@@ -213,6 +214,14 @@ en:
213
214
  Unknown service '%{service}'.
214
215
  Supported services are %{services}.
215
216
 
217
+ # Action related translations
218
+ actions:
219
+ service_success: '%{service} service configured successfully...'
220
+ service_failure: '%{service} service failed to configure properly...'
221
+ private_network: |-
222
+ When using Virtualbox, a non-NAT network interface is required.
223
+ Adding a private network using DHCP
224
+
216
225
  # Kube config template translation
217
226
  kube_config: |-
218
227
  apiVersion: v1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-service-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Exelbierd
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-12 00:00:00.000000000 Z
12
+ date: 2016-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
@@ -61,6 +61,7 @@ files:
61
61
  - features/service-operation.feature
62
62
  - features/support/env.rb
63
63
  - lib/vagrant-service-manager.rb
64
+ - lib/vagrant-service-manager/action/log_configured_service.rb
64
65
  - lib/vagrant-service-manager/action/setup_network.rb
65
66
  - lib/vagrant-service-manager/archive_handlers/tar_handler.rb
66
67
  - lib/vagrant-service-manager/archive_handlers/zip_handler.rb