vagrant-mos 0.9.20 → 0.9.21

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: 9bae12df04b93f0f02bdae078f6d1f10760f4933
4
- data.tar.gz: e92c667ebe41e4d81e39e4c85db93d51f71409a3
3
+ metadata.gz: 45f82edbe87bfdf7054790b4e9f809b8e3b263cb
4
+ data.tar.gz: 6bcb2b58893150c21f47222e0de992527d3f8b32
5
5
  SHA512:
6
- metadata.gz: a24f9f4a9ee686d2879bb96db22c813cc169405cd83497dee46be0b54de6cf30a70e6bd27eee6de9f9251063f523ce4253d387671347e74a3e3820bbf21ca5c8
7
- data.tar.gz: 97a607b2d35f4786f88e6fcfc1fc816414d90ba5059f60818083a1f89ec12c642981b98767271129410a97b820d5b56c2dd1f1692ae1ac3e7de304f5512f05ba
6
+ metadata.gz: 8d7b4b6c452f255a0800cf8c539ed383eda096e5f4d1e29066954bd813e7dc66edb611177450ab2d69d1cace595617b572c3db649c3d1346c574630823e3e639
7
+ data.tar.gz: c5ee63ab8f464dd3c20a00731db8e59dc094166b49ebf1af380bb8f2b5c94d0baa3d87acee14e68bab3357637e201fb45cd543eaca2a66d52544143f5f87c909
data/README.md CHANGED
@@ -56,9 +56,9 @@ Vagrant.configure("2") do |config|
56
56
  config.vm.box = "mos_box"
57
57
 
58
58
  config.vm.provider :mos do |mos, override|
59
- mos.access_key_id = "YOUR KEY"
60
- mos.secret_access_key = "YOUR SECRET KEY"
61
- mos.secret_access_url = "YOUR MOS ACCESS URL"
59
+ mos.access_key = "YOUR KEY"
60
+ mos.access_secret = "YOUR SECRET KEY"
61
+ mos.access_ur = "YOUR MOS ACCESS URL"
62
62
  mos.keypair_name = "KEYPAIR NAME"
63
63
 
64
64
  mos.template_id = "fa1026fe-c082-4ead-8458-802bf65ca64c"
@@ -82,9 +82,9 @@ end
82
82
 
83
83
  MOS provider设置了若干参数,主要参数说明如下:
84
84
 
85
- * `access_key_id` - 访问美团云的key
86
- * `secret_access_key` - 访问美团云的secret
87
- * `secret_access_url` -访问美团云的url
85
+ * `access_key` - 访问美团云的key
86
+ * `access_secret` - 访问美团云的secret
87
+ * `access_ur` -访问美团云的url
88
88
  * `region` - 创建主机的region,例如 "us-east-1"
89
89
  * `template_id` - 创建美团云主机的镜像,例如 "fa1026fe-c082-4ead-8458-802bf65ca64c",用户可以使用`vagrant mos-templates`查看可以使用的镜像
90
90
  * `instance_ready_timeout` - 等待MOS主机创建成功最长时间,单位为秒。默认为120s。
@@ -100,9 +100,9 @@ Vagrant.configure("2") do |config|
100
100
  # ... other stuff
101
101
 
102
102
  config.vm.provider :mos do |mos|
103
- mos.access_key_id = "your_key"
104
- mos.secret_access_key = "your_secret"
105
- mos.secret_access_url = "your_access_url"
103
+ mos.access_key = "your_key"
104
+ mos.access_secret = "your_secret"
105
+ mos.access_ur = "your_access_url"
106
106
  end
107
107
  end
108
108
  ```
data/README_en.md CHANGED
@@ -58,9 +58,9 @@ your information where necessary.
58
58
  Vagrant.configure("2") do |config|
59
59
  config.vm.box = "mos_box"
60
60
  config.vm.provider :mos do |mos, override|
61
- mos.access_key_id = "YOUR KEY"
62
- mos.secret_access_key = "YOUR SECRET KEY"
63
- mos.secret_access_url = "YOUR MOS ACCESS URL"
61
+ mos.access_key = "YOUR KEY"
62
+ mos.access_secret = "YOUR SECRET KEY"
63
+ mos.access_ur = "YOUR MOS ACCESS URL"
64
64
  mos.keypair_name = "KEYPAIR NAME"
65
65
  mos.template_id = "fa1026fe-c082-4ead-8458-802bf65ca64c"
66
66
  override.ssh.username = "root"
@@ -97,7 +97,7 @@ provider-specific configuration for this provider.
97
97
 
98
98
  This provider exposes quite a few provider-specific configuration options:
99
99
 
100
- * `access_key_id` - The access key for accessing MOS
100
+ * `access_key` - The access key for accessing MOS
101
101
  * `template_id` - The image id to boot, such as "fa1026fe-c082-4ead-8458-802bf65ca64c"
102
102
  * `instance_ready_timeout` - The number of seconds to wait for the instance
103
103
  to become "ready" in MOS. Defaults to 120 seconds.
@@ -107,9 +107,9 @@ This provider exposes quite a few provider-specific configuration options:
107
107
  value of this if not specified is "C1_M2".
108
108
  * `keypair_name` - The name of the keypair to use to bootstrap images.
109
109
  which support it.
110
- * `secret_access_url` - The accee url for accessing MOS
110
+ * `access_ur` - The accee url for accessing MOS
111
111
  * `region` - The region to start the instance in, such as "us-east-1"
112
- * `secret_access_key` - The secret access key for accessing MOS
112
+ * `access_secret` - The secret access key for accessing MOS
113
113
  * `use_iam_profile` - If true, will use [IAM profiles](http://docs.mos.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
114
114
  for credentials.
115
115
 
@@ -120,9 +120,9 @@ Vagrant.configure("2") do |config|
120
120
  # ... other stuff
121
121
 
122
122
  config.vm.provider :mos do |mos|
123
- mos.access_key_id = "your_key"
124
- mos.secret_access_key = "your_secret"
125
- mos.secret_access_url = "your_access_url"
123
+ mos.access_key = "your_key"
124
+ mos.access_secret = "your_secret"
125
+ mos.access_ur = "your_access_url"
126
126
  end
127
127
  end
128
128
  ```
@@ -137,8 +137,8 @@ Vagrant.configure("2") do |config|
137
137
  # ... other stuff
138
138
 
139
139
  config.vm.provider :mos do |mos|
140
- mos.access_key_id = "foo"
141
- mos.secret_access_key = "bar"
140
+ mos.access_key = "foo"
141
+ mos.access_secret = "bar"
142
142
  mos.region = "us-east-1"
143
143
 
144
144
  # Simple region config
@@ -22,7 +22,7 @@ module VagrantPlugins
22
22
  region_config = env[:machine].provider_config.get_region_config(region)
23
23
 
24
24
  @logger.info("Connecting to MOS...")
25
- env[:mos_compute] = Client.new(region_config.access_key_id, region_config.secret_access_key, region_config.secret_access_url)
25
+ env[:mos_compute] = Client.new(region_config.access_key, region_config.access_secret, region_config.access_ur)
26
26
 
27
27
  @app.call(env)
28
28
  end
@@ -12,7 +12,7 @@ module VagrantPlugins
12
12
  region_config = machine.provider_config.get_region_config(region)
13
13
 
14
14
  @logger.info("Connecting to MOS...")
15
- mos_compute = Client.new(region_config.access_key_id, region_config.secret_access_key, region_config.secret_access_url)
15
+ mos_compute = Client.new(region_config.access_key, region_config.access_secret, region_config.access_ur)
16
16
  results = mos_compute.describe_templates['Template']
17
17
  puts results
18
18
  0
@@ -6,7 +6,7 @@ module VagrantPlugins
6
6
  # The access key ID for accessing MOS.
7
7
  #
8
8
  # @return [String]
9
- attr_accessor :access_key_id
9
+ attr_accessor :access_key
10
10
 
11
11
  # The ID of the image to use.
12
12
  #
@@ -46,15 +46,15 @@ module VagrantPlugins
46
46
  # The secret access key for accessing MOS.
47
47
  #
48
48
  # @return [String]
49
- attr_accessor :secret_access_key
49
+ attr_accessor :access_secret
50
50
 
51
51
  # The secret access url for accessing MOS.
52
52
  #
53
53
  # @return [String]
54
- attr_accessor :secret_access_url
54
+ attr_accessor :access_ur
55
55
 
56
56
  # Use IAM Instance Role for authentication to MOS instead of an
57
- # explicit access_id and secret_access_key
57
+ # explicit access_id and access_secret
58
58
  #
59
59
  # @return [Boolean]
60
60
  attr_accessor :use_iam_profile
@@ -75,7 +75,7 @@ module VagrantPlugins
75
75
  attr_accessor :ssh_host_attribute
76
76
 
77
77
  def initialize(region_specific=false)
78
- @access_key_id = UNSET_VALUE
78
+ @access_key = UNSET_VALUE
79
79
  @template_id = UNSET_VALUE
80
80
  @instance_ready_timeout = UNSET_VALUE
81
81
  @name = UNSET_VALUE
@@ -83,8 +83,8 @@ module VagrantPlugins
83
83
  @keypair_name = UNSET_VALUE
84
84
  @region = UNSET_VALUE
85
85
  @version = UNSET_VALUE
86
- @secret_access_key = UNSET_VALUE
87
- @secret_access_url = UNSET_VALUE
86
+ @access_secret = UNSET_VALUE
87
+ @access_ur = UNSET_VALUE
88
88
  @use_iam_profile = UNSET_VALUE
89
89
  @terminate_on_shutdown = UNSET_VALUE
90
90
  @ssh_host_attribute = UNSET_VALUE
@@ -157,9 +157,9 @@ module VagrantPlugins
157
157
  def finalize!
158
158
  # Try to get access keys from standard MOS environment variables; they
159
159
  # will default to nil if the environment variables are not present.
160
- @access_key_id = ENV['MOS_ACCESS_KEY'] if @access_key_id == UNSET_VALUE
161
- @secret_access_key = ENV['MOS_SECRET_KEY'] if @secret_access_key == UNSET_VALUE
162
- @secret_access_url = ENV['MOS_SECRET_URL'] if @secret_access_url == UNSET_VALUE
160
+ @access_key = ENV['MOS_ACCESS_KEY'] if @access_key == UNSET_VALUE
161
+ @access_secret = ENV['MOS_SECRET_KEY'] if @access_secret == UNSET_VALUE
162
+ @access_ur = ENV['MOS_SECRET_URL'] if @access_ur == UNSET_VALUE
163
163
 
164
164
  # Template_id must be nil, since we can't default that
165
165
  @template_id = nil if @template_id == UNSET_VALUE
@@ -226,12 +226,12 @@ module VagrantPlugins
226
226
  config = get_region_config(@region)
227
227
 
228
228
  if !config.use_iam_profile
229
- errors << I18n.t("vagrant_mos.config.access_key_id_required") if \
230
- config.access_key_id.nil?
231
- errors << I18n.t("vagrant_mos.config.secret_access_key_required") if \
232
- config.secret_access_key.nil?
233
- errors << I18n.t("vagrant_mos.config.secret_access_url_required") if \
234
- config.secret_access_url.nil?
229
+ errors << I18n.t("vagrant_mos.config.access_key_required") if \
230
+ config.access_key.nil?
231
+ errors << I18n.t("vagrant_mos.config.access_secret_required") if \
232
+ config.access_secret.nil?
233
+ errors << I18n.t("vagrant_mos.config.access_ur_required") if \
234
+ config.access_ur.nil?
235
235
  end
236
236
 
237
237
  errors << I18n.interpolate("vagrant_mos.config.template_id_required", :region => @region) if config.template_id.nil?
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module MOS
3
- VERSION = '0.9.20'
3
+ VERSION = '0.9.21'
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -39,18 +39,18 @@ en:
39
39
  was declined.
40
40
 
41
41
  config:
42
- access_key_id_required: |-
43
- An access key ID must be specified via "access_key_id"
42
+ access_key_required: |-
43
+ An access key ID must be specified via "access_key"
44
44
  template_id_required: |-
45
45
  An template_id must be configured via "template_id" (region: #{region})
46
46
  private_key_missing: |-
47
47
  The specified private key for MOS could not be found
48
48
  region_required: |-
49
49
  A region must be specified via "region"
50
- secret_access_key_required: |-
51
- A secret access key is required via "secret_access_key"
52
- secret_access_url_required: |-
53
- A secret access url is required via "secret_access_url"
50
+ access_secret_required: |-
51
+ A secret access key is required via "access_secret"
52
+ access_ur_required: |-
53
+ A secret access url is required via "access_ur"
54
54
 
55
55
  errors:
56
56
  mos_error: |-
@@ -15,15 +15,15 @@ describe VagrantPlugins::MOS::Config do
15
15
  end
16
16
  end
17
17
 
18
- its("access_key_id") { should be_nil }
18
+ its("access_key") { should be_nil }
19
19
  its("template_id") { should be_nil }
20
20
  its("instance_ready_timeout") { should == 120 }
21
21
  its("name") { should be_nil }
22
22
  its("instance_type") { should == "C1_M2" }
23
23
  its("keypair_name") { should be_nil }
24
24
  its("region") { should == "us-east-1" }
25
- its("secret_access_key") { should be_nil }
26
- its("secret_access_url") { should be_nil }
25
+ its("access_secret") { should be_nil }
26
+ its("access_ur") { should be_nil }
27
27
  its("use_iam_profile") { should be_false }
28
28
  its("terminate_on_shutdown") { should == false }
29
29
  its("ssh_host_attribute") { should be_nil }
@@ -34,9 +34,9 @@ describe VagrantPlugins::MOS::Config do
34
34
  # simple boilerplate test, so I cut corners here. It just sets
35
35
  # each of these attributes to "foo" in isolation, and reads the value
36
36
  # and asserts the proper result comes back out.
37
- [:access_key_id, :template_id, :instance_ready_timeout,:name,
37
+ [:access_key, :template_id, :instance_ready_timeout,:name,
38
38
  :instance_type, :keypair_name, :ssh_host_attribute,
39
- :region, :secret_access_key, :secret_access_url, :terminate_on_shutdown,
39
+ :region, :access_secret, :access_ur, :terminate_on_shutdown,
40
40
  :use_iam_profile].each do |attribute|
41
41
 
42
42
  it "should not default #{attribute} if overridden" do
@@ -60,9 +60,9 @@ describe VagrantPlugins::MOS::Config do
60
60
  end
61
61
  end
62
62
 
63
- its("access_key_id") { should be_nil }
64
- its("secret_access_key") { should be_nil }
65
- its("secret_access_url") { should be_nil }
63
+ its("access_key") { should be_nil }
64
+ its("access_secret") { should be_nil }
65
+ its("access_ur") { should be_nil }
66
66
  end
67
67
 
68
68
  context "with MOS credential environment variables" do
@@ -78,31 +78,31 @@ describe VagrantPlugins::MOS::Config do
78
78
  end
79
79
  end
80
80
 
81
- its("access_key_id") { should == "access_key" }
82
- its("secret_access_key") { should == "secret_key" }
83
- its("secret_access_url") { should == "secret_url" }
81
+ its("access_key") { should == "access_key" }
82
+ its("access_secret") { should == "secret_key" }
83
+ its("access_ur") { should == "secret_url" }
84
84
  end
85
85
  end
86
86
 
87
87
  describe "region config" do
88
- let(:config_access_key_id) { "foo" }
88
+ let(:config_access_key) { "foo" }
89
89
  let(:config_template_id) { "foo" }
90
90
  let(:config_instance_type) { "foo" }
91
91
  let(:config_name) { "foo" }
92
92
  let(:config_keypair_name) { "foo" }
93
93
  let(:config_region) { "foo" }
94
- let(:config_secret_access_key) { "foo" }
95
- let(:config_secret_access_url) { "foo" }
94
+ let(:config_access_secret) { "foo" }
95
+ let(:config_access_ur) { "foo" }
96
96
 
97
97
  def set_test_values(instance)
98
- instance.access_key_id = config_access_key_id
98
+ instance.access_key = config_access_key
99
99
  instance.template_id = config_template_id
100
100
  instance.instance_type = config_instance_type
101
101
  instance.name = config_name
102
102
  instance.keypair_name = config_keypair_name
103
103
  instance.region = config_region
104
- instance.secret_access_key = config_secret_access_key
105
- instance.secret_access_url = config_secret_access_url
104
+ instance.access_secret = config_access_secret
105
+ instance.access_ur = config_access_ur
106
106
  end
107
107
 
108
108
  it "should raise an exception if not finalized" do
@@ -122,14 +122,14 @@ describe VagrantPlugins::MOS::Config do
122
122
  instance.get_region_config("us-east-1")
123
123
  end
124
124
 
125
- its("access_key_id") { should == config_access_key_id }
125
+ its("access_key") { should == config_access_key }
126
126
  its("template_id") { should == config_template_id }
127
127
  its("instance_type") { should == config_instance_type }
128
128
  its("name") { should == config_name }
129
129
  its("keypair_name") { should == config_keypair_name }
130
130
  its("region") { should == config_region }
131
- its("secret_access_key") { should == config_secret_access_key }
132
- its("secret_access_url") { should == config_secret_access_url }
131
+ its("access_secret") { should == config_access_secret }
132
+ its("access_ur") { should == config_access_ur }
133
133
  end
134
134
 
135
135
  context "with a specific config set" do
@@ -148,14 +148,14 @@ describe VagrantPlugins::MOS::Config do
148
148
  instance.get_region_config(region_name)
149
149
  end
150
150
 
151
- its("access_key_id") { should == config_access_key_id }
151
+ its("access_key") { should == config_access_key }
152
152
  its("template_id") { should == config_template_id }
153
153
  its("instance_type") { should == config_instance_type }
154
154
  its("name") { should == config_name }
155
155
  its("keypair_name") { should == config_keypair_name }
156
156
  its("region") { should == region_name }
157
- its("secret_access_key") { should == config_secret_access_key }
158
- its("secret_access_url") { should == config_secret_access_url }
157
+ its("access_secret") { should == config_access_secret }
158
+ its("access_ur") { should == config_access_ur }
159
159
  end
160
160
 
161
161
  describe "inheritance of parent config" do
@@ -168,7 +168,7 @@ describe VagrantPlugins::MOS::Config do
168
168
  end
169
169
 
170
170
  # Set some top-level values
171
- instance.access_key_id = "parent"
171
+ instance.access_key = "parent"
172
172
  instance.template_id = "parent"
173
173
 
174
174
  # Finalize and get the region
@@ -176,7 +176,7 @@ describe VagrantPlugins::MOS::Config do
176
176
  instance.get_region_config(region_name)
177
177
  end
178
178
 
179
- its("access_key_id") { should == "parent" }
179
+ its("access_key") { should == "parent" }
180
180
  its("template_id") { should == "child" }
181
181
  end
182
182
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-mos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.20
4
+ version: 0.9.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - yangcs2009