vagrant-aws-extras 0.0.1.rc2 → 0.0.1.rc4

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: cf635847008a5c0da7d9b817ded42cf1c5d70cd9
4
- data.tar.gz: 960b1da22bdcb80b2e8e44c32979862c1dc156ec
3
+ metadata.gz: deb61529dad89d1898388941137fe0bf26d62690
4
+ data.tar.gz: a94af23b0e09d8ea83d03459966729e3adde6f4d
5
5
  SHA512:
6
- metadata.gz: b60b9f83967f2b18ad7bbb305d2a3d2629196125053c9d13a511984688d88b833e422b36a1a3f3157bc464d2f88ef8613f24a6405b03d0bf7266fc17f557a3ae
7
- data.tar.gz: c3d830f1dc1716a8316ce17e04d5e287d92a7183e021d92e1f65e4264bb402acb0b270ba80c8c68ad94ec57d06dc41ac301f56de0a582b4c7c11d75f92b12664
6
+ metadata.gz: 4bf382a894fa6dcefe4102fd1ea3e54004ef59c2590ed9b56f8f3badc374010489366d887e98b7a494a08c45971a62c75c45883604625c73790748ea33ce8823
7
+ data.tar.gz: 2fbdc2a3e6d8fdef0bcab89a158820fb7fca2918d1317c4d9c81627cf3fd5436a9db448e0245bc22071a54533297f9c0ff00beb66c3f9c8a9b012f80280522fd
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ group :development do
7
7
  # We depend on Vagrant for development, but we don't add it as a
8
8
  # gem dependency because we expect to be installed within the
9
9
  # Vagrant environment itself using `vagrant plugin`.
10
+ gem "vagrant-aws"
10
11
  gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.2.7"
11
12
  gem "vagrant-rspec-ci", "~> 1.0.1"
12
13
  end
@@ -7,6 +7,16 @@ module VagrantPlugins
7
7
  module Extras
8
8
  module Action
9
9
  module DNS
10
+ class ProviderIsAWS
11
+ def initialize(app, env)
12
+ @app = app
13
+ end
14
+
15
+ def call(env)
16
+ env[:result] = env[:machine].provider_name == "aws"
17
+ @app.call(env)
18
+ end
19
+ end
10
20
  class ConnectAWS
11
21
  def initialize(app, env)
12
22
  @app = app
@@ -11,21 +11,29 @@ module VagrantPlugins
11
11
 
12
12
  def self.action_up
13
13
  Vagrant::Action::Builder.new.tap do |builder|
14
- builder.use ConfigValidate
15
- builder.use ::VagrantPlugins::AWS::Action::ConnectAWS
16
- builder.use ::VagrantPlugins::AWS::Action::ReadSSHInfo
17
- builder.use DNS::ConnectAWS
18
- builder.use DNS::Set
14
+ builder.use Call, DNS::ProviderIsAWS do |env, aws_builder|
15
+ if env[:result]
16
+ aws_builder.use ConfigValidate
17
+ aws_builder.use ::VagrantPlugins::AWS::Action::ConnectAWS
18
+ aws_builder.use ::VagrantPlugins::AWS::Action::ReadSSHInfo
19
+ aws_builder.use DNS::ConnectAWS
20
+ aws_builder.use DNS::Set
21
+ end
22
+ end
19
23
  end
20
24
  end
21
25
 
22
26
  def self.action_destroy
23
27
  Vagrant::Action::Builder.new.tap do |builder|
24
- builder.use ConfigValidate
25
- builder.use ::VagrantPlugins::AWS::Action::ConnectAWS
26
- builder.use ::VagrantPlugins::AWS::Action::ReadSSHInfo
27
- builder.use DNS::ConnectAWS
28
- builder.use DNS::Remove
28
+ builder.use Call, DNS::ProviderIsAWS do |env, aws_builder|
29
+ if env[:result]
30
+ aws_builder.use ConfigValidate
31
+ aws_builder.use ::VagrantPlugins::AWS::Action::ConnectAWS
32
+ aws_builder.use ::VagrantPlugins::AWS::Action::ReadSSHInfo
33
+ aws_builder.use DNS::ConnectAWS
34
+ aws_builder.use DNS::Remove
35
+ end
36
+ end
29
37
  end
30
38
  end
31
39
 
@@ -46,13 +46,15 @@ module VagrantPlugins
46
46
  def finalize!
47
47
  @record_zone = nil if @record_zone == UNSET_VALUE
48
48
  @record_type = "CNAME" if @record_type == UNSET_VALUE
49
- @record_name = nil if @record_name == UNSET_VALUE
49
+ @record_name = nil if @record_name == UNSET_VALUE
50
50
  @record_ttl = 3600 if @record_ttl == UNSET_VALUE
51
51
  @remove_on_suspend = true if @remove_on_suspend == UNSET_VALUE
52
52
  @remove_on_destroy = true if @remove_on_destroy == UNSET_VALUE
53
53
  end
54
54
 
55
55
  def validate(machine)
56
+ return {} if machine.provider_name != "aws"
57
+
56
58
  errors = []
57
59
  errors.push "record zone must be set" unless @record_zone
58
60
  errors.push "record name must be set" unless @record_name
@@ -1,7 +1,7 @@
1
1
  module VagrantPlugins
2
2
  module AWS
3
3
  module Extras
4
- VERSION = "0.0.1.rc2"
4
+ VERSION = "0.0.1.rc4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-aws-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc2
4
+ version: 0.0.1.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaakko Suutarla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-05 00:00:00.000000000 Z
11
+ date: 2013-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vagrant-aws