pec 0.8.3 → 0.8.4

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: 6164ca7dc80a1d9c45e2cd334571988a4acc2709
4
- data.tar.gz: 846f134bc1adceb7d2d22dc023706581e036a734
3
+ metadata.gz: 7d767f21c81f292ff209756c5a8ab2d88d6a9ecf
4
+ data.tar.gz: 2429a9b982c55c316cbdf557f4ce7783b5170e81
5
5
  SHA512:
6
- metadata.gz: 19e33afa2cd99d003104942ce7213c65cba276339e3589a058efd8d767165d5d8a31f401695c390fbec2417a258da533a674de73111b4e12e520d546dae4f5f7
7
- data.tar.gz: 1b16fab8f5419394243d01853053381028f90d2d4c91e5df6370d46b06c340a41a588ddb344a4b2a9a8d034d8b468948ea395306dcff4f001807511f27731e58
6
+ metadata.gz: c509c4b70b4f91d7104b1be01ec66b700395421b8685bfaf821ac281e52e74f9097a1cd17fab58b3e0b8d44812514188d6ee5ca8879295346b1fbcb0bf326e14
7
+ data.tar.gz: a71b925735c65c18371fc4cde42327f7007f671fce3214ae269e66a8cf8a46cdb8a6346c466e660226e258afe2585b61adbe180a3ee1e1b2237a59337b4bee35
@@ -16,6 +16,8 @@ module Pec::Command
16
16
  Pec::Logger.critical(e)
17
17
  Pec::Logger.warning "recovery start #{config.name}"
18
18
 
19
+ attribute.deep_merge!(e.attribute) if e.is_a?(Pec::PortError) && e.attribute
20
+
19
21
  Pec.processor_matching(config, Pec::Handler) do |klass|
20
22
  klass.recover(attribute)
21
23
  end
@@ -1,3 +1,4 @@
1
+ require "pec/port_error"
1
2
  module Pec::Handler
2
3
  class Networks
3
4
  extend Pec::Core
@@ -21,6 +22,8 @@ module Pec::Handler
21
22
  {
22
23
  networks: ports.map {|port| { uuid: nil, port: port.id }}
23
24
  }
25
+ rescue Yao::Conflict => e
26
+ raise(Pec::PortError.new(ports), e)
24
27
  end
25
28
 
26
29
  def recover(attribute)
@@ -0,0 +1,8 @@
1
+ class Pec::PortError < StandardError
2
+ attr_accessor :attribute
3
+ def initialize(ports)
4
+ self.attribute = {
5
+ networks: ports.map {|port| { uuid: nil, port: port.id }}
6
+ } if ports
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Pec
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuhiko yamashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-15 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -171,6 +171,7 @@ files:
171
171
  - lib/pec/handler/user_data/nic/ubuntu.rb
172
172
  - lib/pec/init.rb
173
173
  - lib/pec/logger.rb
174
+ - lib/pec/port_error.rb
174
175
  - lib/pec/sample.rb
175
176
  - lib/pec/version.rb
176
177
  - pec.gemspec