vagrant-kvm 0.1.8 → 0.1.9
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/lib/vagrant-kvm/action.rb +2 -2
- data/lib/vagrant-kvm/action/network.rb +0 -9
- data/lib/vagrant-kvm/action/new_mac_address.rb +28 -0
- data/lib/vagrant-kvm/version.rb +1 -1
- data/locales/en.yml +2 -0
- data/locales/ja.yml +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa4f4087c77fcb876af64a5f594b085f7f3917b3
|
4
|
+
data.tar.gz: 07bd965570032c753a326c1d82d859c441495b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f3e0c5026f39cab4d2086e5e0adf0bd4e5a06148a323d63d050d178c6159012f573ed0d0eda56a5cc8cbb8af57e21dbd0f34a95b8ee7ae5b3a5d529f7dcd59b
|
7
|
+
data.tar.gz: ae9fd175eddc447e2d4c1586915b1573a2042aaf2e82f9ef18937db011176ad757590909c0cdd252dabe08658f53db55b73824b07bcd6bd5efa0e4579d0f62f6
|
data/lib/vagrant-kvm/action.rb
CHANGED
@@ -258,7 +258,7 @@ module VagrantPlugins
|
|
258
258
|
# XXX there must be a better way
|
259
259
|
b2.use InitStoragePool
|
260
260
|
b2.use Import
|
261
|
-
b2.use
|
261
|
+
b2.use NewMACAddress
|
262
262
|
b2.use Network
|
263
263
|
end
|
264
264
|
end
|
@@ -286,7 +286,7 @@ module VagrantPlugins
|
|
286
286
|
autoload :IsPaused, action_root.join("is_paused")
|
287
287
|
autoload :IsRunning, action_root.join("is_running")
|
288
288
|
autoload :IsSaved, action_root.join("is_saved")
|
289
|
-
autoload :
|
289
|
+
autoload :NewMACAddress, action_root.join("new_mac_address")
|
290
290
|
autoload :MessageNotCreated, action_root.join("message_not_created")
|
291
291
|
autoload :MessageNotRunning, action_root.join("message_not_running")
|
292
292
|
autoload :MessageWillNotDestroy, action_root.join("message_will_not_destroy")
|
@@ -140,15 +140,6 @@ module VagrantPlugins
|
|
140
140
|
options
|
141
141
|
end
|
142
142
|
|
143
|
-
def random_mac
|
144
|
-
rng = Random.new(Time.now.to_i)
|
145
|
-
mac = [0x00, 0x16, 0x3e,
|
146
|
-
rng.rand(128),
|
147
|
-
rng.rand(256),
|
148
|
-
rng.rand(256)]
|
149
|
-
mac.map {|x| "%02x" % x}.join(":")
|
150
|
-
end
|
151
|
-
|
152
143
|
def format_mac(mac)
|
153
144
|
return nil unless mac
|
154
145
|
if mac.length == 12
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module ProviderKvm
|
3
|
+
module Action
|
4
|
+
class NewMACAddress
|
5
|
+
def initialize(app, env)
|
6
|
+
@app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
# Generate a new mac address for the vm
|
11
|
+
env[:ui].info I18n.t("vagrant_kvm.new_mac_address")
|
12
|
+
env[:machine].provider.driver.set_mac_address(random_mac)
|
13
|
+
|
14
|
+
@app.call(env)
|
15
|
+
end
|
16
|
+
|
17
|
+
def random_mac
|
18
|
+
rng = Random.new(Time.now.to_i)
|
19
|
+
mac = [0x52, 0x54, 0x00, # KVM Vendor prefix
|
20
|
+
rng.rand(128),
|
21
|
+
rng.rand(256),
|
22
|
+
rng.rand(256)]
|
23
|
+
mac.map {|x| "%02x" % x}.join(":")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/vagrant-kvm/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -6,6 +6,8 @@ en:
|
|
6
6
|
Change directory %{directory} permission from %{old_mode} to %{new_mode}.
|
7
7
|
kvm_spool_problem_inform: |-
|
8
8
|
Your vagrant-kvm environment should be fixed. see README.
|
9
|
+
new_mac_address: |-
|
10
|
+
Assigning a new mac address to the VM.
|
9
11
|
errors:
|
10
12
|
kvm_no_connection: |-
|
11
13
|
Cannot connect to KVM through Libvirt. Please check kernel module
|
data/locales/ja.yml
CHANGED
@@ -2,8 +2,12 @@ en:
|
|
2
2
|
vagrant_kvm:
|
3
3
|
test_message: |-
|
4
4
|
これはテストメッセージです。
|
5
|
+
repair_permission: |-
|
6
|
+
Change directory %{directory} permission from %{old_mode} to %{new_mode}.
|
5
7
|
kvm_spool_problem_inform: |-
|
6
8
|
このVagrant-kvm環境は修正の必要があります。READMEを確認してください。
|
9
|
+
new_mac_address: |-
|
10
|
+
Assigning a new mac address to the VM.
|
7
11
|
errors:
|
8
12
|
kvm_no_connection: |-
|
9
13
|
KVMにLibvirt経由で接続できません。カーネルモジュールの
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-kvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Drahon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-libvirt
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- lib/vagrant-kvm/action/prepare_kvmconfig.rb
|
177
177
|
- lib/vagrant-kvm/action/check_running.rb
|
178
178
|
- lib/vagrant-kvm/action/check_kvm.rb
|
179
|
+
- lib/vagrant-kvm/action/new_mac_address.rb
|
179
180
|
- lib/vagrant-kvm/action/is_saved.rb
|
180
181
|
- lib/vagrant-kvm/action/is_running.rb
|
181
182
|
- lib/vagrant-kvm/action/message_not_created.rb
|