vagrant-mos 0.9.21 → 0.9.22
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 +4 -4
- data/README.md +3 -3
- data/README_en.md +3 -3
- data/lib/vagrant-mos/action/connect_mos.rb +1 -1
- data/lib/vagrant-mos/command.rb +1 -1
- data/lib/vagrant-mos/config.rb +5 -5
- data/lib/vagrant-mos/version.rb +1 -1
- data/locales/en.yml +2 -2
- data/spec/vagrant-mos/config_spec.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59e8c991547bfb7555e28e96c2e52528498c85e4
|
4
|
+
data.tar.gz: ec50bd104241ec26fe1f4ffddba38db553bdec16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1e0ea145f8ebb7ed9e3650b451be5892f4dcb01e676199dd034c223c146070613671064575a33128417b16bb6b094fe8f3f7f65d7016909ca73ec0e743311f5
|
7
|
+
data.tar.gz: 3694313d40e5bb402e48bd88d26e1d16612cf8c92cc83621ce7429a9188c93019da15f5ecf4d6fde0ea1ef3cda37ebd9de52213b8954a9d17a96faa8ab6ca226
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ Vagrant.configure("2") do |config|
|
|
58
58
|
config.vm.provider :mos do |mos, override|
|
59
59
|
mos.access_key = "YOUR KEY"
|
60
60
|
mos.access_secret = "YOUR SECRET KEY"
|
61
|
-
mos.
|
61
|
+
mos.access_url = "YOUR MOS ACCESS URL"
|
62
62
|
mos.keypair_name = "KEYPAIR NAME"
|
63
63
|
|
64
64
|
mos.template_id = "fa1026fe-c082-4ead-8458-802bf65ca64c"
|
@@ -84,7 +84,7 @@ MOS provider设置了若干参数,主要参数说明如下:
|
|
84
84
|
|
85
85
|
* `access_key` - 访问美团云的key
|
86
86
|
* `access_secret` - 访问美团云的secret
|
87
|
-
* `
|
87
|
+
* `access_url` -访问美团云的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。
|
@@ -102,7 +102,7 @@ Vagrant.configure("2") do |config|
|
|
102
102
|
config.vm.provider :mos do |mos|
|
103
103
|
mos.access_key = "your_key"
|
104
104
|
mos.access_secret = "your_secret"
|
105
|
-
mos.
|
105
|
+
mos.access_url = "your_access_urll"
|
106
106
|
end
|
107
107
|
end
|
108
108
|
```
|
data/README_en.md
CHANGED
@@ -60,7 +60,7 @@ Vagrant.configure("2") do |config|
|
|
60
60
|
config.vm.provider :mos do |mos, override|
|
61
61
|
mos.access_key = "YOUR KEY"
|
62
62
|
mos.access_secret = "YOUR SECRET KEY"
|
63
|
-
mos.
|
63
|
+
mos.access_url = "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"
|
@@ -107,7 +107,7 @@ 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
|
-
* `
|
110
|
+
* `access_url` - The accee url for accessing MOS
|
111
111
|
* `region` - The region to start the instance in, such as "us-east-1"
|
112
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)
|
@@ -122,7 +122,7 @@ Vagrant.configure("2") do |config|
|
|
122
122
|
config.vm.provider :mos do |mos|
|
123
123
|
mos.access_key = "your_key"
|
124
124
|
mos.access_secret = "your_secret"
|
125
|
-
mos.
|
125
|
+
mos.access_url = "your_access_urll"
|
126
126
|
end
|
127
127
|
end
|
128
128
|
```
|
@@ -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, region_config.access_secret, region_config.
|
25
|
+
env[:mos_compute] = Client.new(region_config.access_key, region_config.access_secret, region_config.access_url)
|
26
26
|
|
27
27
|
@app.call(env)
|
28
28
|
end
|
data/lib/vagrant-mos/command.rb
CHANGED
@@ -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, region_config.access_secret, region_config.
|
15
|
+
mos_compute = Client.new(region_config.access_key, region_config.access_secret, region_config.access_url)
|
16
16
|
results = mos_compute.describe_templates['Template']
|
17
17
|
puts results
|
18
18
|
0
|
data/lib/vagrant-mos/config.rb
CHANGED
@@ -51,7 +51,7 @@ module VagrantPlugins
|
|
51
51
|
# The secret access url for accessing MOS.
|
52
52
|
#
|
53
53
|
# @return [String]
|
54
|
-
attr_accessor :
|
54
|
+
attr_accessor :access_url
|
55
55
|
|
56
56
|
# Use IAM Instance Role for authentication to MOS instead of an
|
57
57
|
# explicit access_id and access_secret
|
@@ -84,7 +84,7 @@ module VagrantPlugins
|
|
84
84
|
@region = UNSET_VALUE
|
85
85
|
@version = UNSET_VALUE
|
86
86
|
@access_secret = UNSET_VALUE
|
87
|
-
@
|
87
|
+
@access_url = UNSET_VALUE
|
88
88
|
@use_iam_profile = UNSET_VALUE
|
89
89
|
@terminate_on_shutdown = UNSET_VALUE
|
90
90
|
@ssh_host_attribute = UNSET_VALUE
|
@@ -159,7 +159,7 @@ module VagrantPlugins
|
|
159
159
|
# will default to nil if the environment variables are not present.
|
160
160
|
@access_key = ENV['MOS_ACCESS_KEY'] if @access_key == UNSET_VALUE
|
161
161
|
@access_secret = ENV['MOS_SECRET_KEY'] if @access_secret == UNSET_VALUE
|
162
|
-
@
|
162
|
+
@access_url = ENV['MOS_SECRET_URL'] if @access_url == 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
|
@@ -230,8 +230,8 @@ module VagrantPlugins
|
|
230
230
|
config.access_key.nil?
|
231
231
|
errors << I18n.t("vagrant_mos.config.access_secret_required") if \
|
232
232
|
config.access_secret.nil?
|
233
|
-
errors << I18n.t("vagrant_mos.config.
|
234
|
-
config.
|
233
|
+
errors << I18n.t("vagrant_mos.config.access_url_required") if \
|
234
|
+
config.access_url.nil?
|
235
235
|
end
|
236
236
|
|
237
237
|
errors << I18n.interpolate("vagrant_mos.config.template_id_required", :region => @region) if config.template_id.nil?
|
data/lib/vagrant-mos/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -49,8 +49,8 @@ en:
|
|
49
49
|
A region must be specified via "region"
|
50
50
|
access_secret_required: |-
|
51
51
|
A secret access key is required via "access_secret"
|
52
|
-
|
53
|
-
A secret access url is required via "
|
52
|
+
access_url_required: |-
|
53
|
+
A secret access url is required via "access_url"
|
54
54
|
|
55
55
|
errors:
|
56
56
|
mos_error: |-
|
@@ -23,7 +23,7 @@ describe VagrantPlugins::MOS::Config do
|
|
23
23
|
its("keypair_name") { should be_nil }
|
24
24
|
its("region") { should == "us-east-1" }
|
25
25
|
its("access_secret") { should be_nil }
|
26
|
-
its("
|
26
|
+
its("access_url") { 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 }
|
@@ -36,7 +36,7 @@ describe VagrantPlugins::MOS::Config do
|
|
36
36
|
# and asserts the proper result comes back out.
|
37
37
|
[:access_key, :template_id, :instance_ready_timeout,:name,
|
38
38
|
:instance_type, :keypair_name, :ssh_host_attribute,
|
39
|
-
:region, :access_secret, :
|
39
|
+
:region, :access_secret, :access_url, :terminate_on_shutdown,
|
40
40
|
:use_iam_profile].each do |attribute|
|
41
41
|
|
42
42
|
it "should not default #{attribute} if overridden" do
|
@@ -62,7 +62,7 @@ describe VagrantPlugins::MOS::Config do
|
|
62
62
|
|
63
63
|
its("access_key") { should be_nil }
|
64
64
|
its("access_secret") { should be_nil }
|
65
|
-
its("
|
65
|
+
its("access_url") { should be_nil }
|
66
66
|
end
|
67
67
|
|
68
68
|
context "with MOS credential environment variables" do
|
@@ -80,7 +80,7 @@ describe VagrantPlugins::MOS::Config do
|
|
80
80
|
|
81
81
|
its("access_key") { should == "access_key" }
|
82
82
|
its("access_secret") { should == "secret_key" }
|
83
|
-
its("
|
83
|
+
its("access_url") { should == "secret_url" }
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -92,7 +92,7 @@ describe VagrantPlugins::MOS::Config do
|
|
92
92
|
let(:config_keypair_name) { "foo" }
|
93
93
|
let(:config_region) { "foo" }
|
94
94
|
let(:config_access_secret) { "foo" }
|
95
|
-
let(:
|
95
|
+
let(:config_access_url) { "foo" }
|
96
96
|
|
97
97
|
def set_test_values(instance)
|
98
98
|
instance.access_key = config_access_key
|
@@ -102,7 +102,7 @@ describe VagrantPlugins::MOS::Config do
|
|
102
102
|
instance.keypair_name = config_keypair_name
|
103
103
|
instance.region = config_region
|
104
104
|
instance.access_secret = config_access_secret
|
105
|
-
instance.
|
105
|
+
instance.access_url = config_access_url
|
106
106
|
end
|
107
107
|
|
108
108
|
it "should raise an exception if not finalized" do
|
@@ -129,7 +129,7 @@ describe VagrantPlugins::MOS::Config do
|
|
129
129
|
its("keypair_name") { should == config_keypair_name }
|
130
130
|
its("region") { should == config_region }
|
131
131
|
its("access_secret") { should == config_access_secret }
|
132
|
-
its("
|
132
|
+
its("access_url") { should == config_access_url }
|
133
133
|
end
|
134
134
|
|
135
135
|
context "with a specific config set" do
|
@@ -155,7 +155,7 @@ describe VagrantPlugins::MOS::Config do
|
|
155
155
|
its("keypair_name") { should == config_keypair_name }
|
156
156
|
its("region") { should == region_name }
|
157
157
|
its("access_secret") { should == config_access_secret }
|
158
|
-
its("
|
158
|
+
its("access_url") { should == config_access_url }
|
159
159
|
end
|
160
160
|
|
161
161
|
describe "inheritance of parent config" do
|