vagrant-libvirt 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ tmp
18
18
  Vagrantfile
19
19
  !example_box/Vagrantfile
20
20
  .vagrant
21
+ *.swp
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.4 (May 5, 2013)
2
+
3
+ * Bug fix in number of parameters for provisioner.
4
+ * Handle box URL when downloading a box.
5
+ * Support for running ssh commands like `vagrant ssh -c "bash cli"`
6
+
1
7
  # 0.0.3 (Apr 11, 2013)
2
8
 
3
9
  * Cpu and memory settings for domains.
@@ -8,8 +14,8 @@
8
14
  # 0.0.2 (Apr 1, 2013)
9
15
 
10
16
  * Halt, suspend, resume, ssh and provision commands added.
11
- * IP address of VM is saved into $data_dir/ip file.
12
- * Provider can be set via VAGRANT_DEFAULT_PROVIDER env variable.
17
+ * IP address of VM is saved into `$data_dir/ip` file.
18
+ * Provider can be set via `VAGRANT_DEFAULT_PROVIDER` env variable.
13
19
 
14
20
  # 0.0.1 (Mar 26, 2013)
15
21
 
data/README.md CHANGED
@@ -4,10 +4,10 @@ This is a [Vagrant](http://www.vagrantup.com) 1.1+ plugin that adds an
4
4
  [Libvirt](http://libvirt.org) provider to Vagrant, allowing Vagrant to
5
5
  control and provision machines via Libvirt toolkit.
6
6
 
7
- **Note:** Actual version (0.0.3) is still a development one. Feedback is
7
+ **Note:** Actual version (0.0.4) is still a development one. Feedback is
8
8
  welcome and can help a lot :-)
9
9
 
10
- ## Features (Version 0.0.3)
10
+ ## Features (Version 0.0.4)
11
11
 
12
12
  * Vagrant `up`, `destroy`, `suspend`, `resume`, `halt`, `ssh` and `provision` commands.
13
13
  * Upload box image (qcow2 format) to Libvirt storage pool.
@@ -140,21 +140,10 @@ Vagrant goes through steps below when creating new project:
140
140
 
141
141
  ## Networks
142
142
 
143
- Networking features in the form of `config.vm.network` are supported only
144
- in bridged format, no hostonly network is supported in current version of
143
+ Networking features in the form of `config.vm.network` are not supported right
144
+ now. Support for private network is planned to be added in next release of
145
145
  provider.
146
146
 
147
- Example of network interface definition:
148
-
149
- ```ruby
150
- config.vm.define :test_vm do |test_vm|
151
- test_vm.vm.network :bridged, :bridge => "default", :adapter => 1
152
- end
153
- ```
154
-
155
- In example above, bridged network adapter connected to network `default` is
156
- defined.
157
-
158
147
  ## Obtaining Domain IP Address
159
148
 
160
149
  Libvirt doesn't provide standard way how to find out an IP address of running
@@ -16,7 +16,12 @@ module VagrantPlugins
16
16
 
17
17
  domain = env[:libvirt_compute].servers.get(env[:machine].id.to_s)
18
18
  raise Errors::NoDomainError if domain == nil
19
- domain.start
19
+
20
+ begin
21
+ domain.start
22
+ rescue => e
23
+ raise Errors::FogError, :message => e.message
24
+ end
20
25
 
21
26
  @app.call(env)
22
27
  end
@@ -6,7 +6,10 @@ module VagrantPlugins
6
6
  # This is the same as the builtin provision except it times the
7
7
  # provisioner runs.
8
8
  class TimedProvision < Vagrant::Action::Builtin::Provision
9
- def run_provisioner(env, p)
9
+ def run_provisioner(env, name, p)
10
+ env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning",
11
+ :provisioner => name))
12
+
10
13
  timer = Util::Timer.time do
11
14
  super
12
15
  end
@@ -16,6 +16,7 @@ module VagrantPlugins
16
16
  if !env[:result]
17
17
  b2.use SetNameOfDomain
18
18
  b2.use HandleStoragePool
19
+ b2.use HandleBoxUrl
19
20
  b2.use HandleBoxImage
20
21
  b2.use CreateDomainVolume
21
22
  b2.use CreateDomain
@@ -221,6 +222,31 @@ module VagrantPlugins
221
222
  end
222
223
  end
223
224
 
225
+ # This is the action that will run a single SSH command.
226
+ def self.action_ssh_run
227
+ Vagrant::Action::Builder.new.tap do |b|
228
+ b.use ConfigValidate
229
+ b.use Call, IsCreated do |env, b2|
230
+ if !env[:result]
231
+ b2.use MessageNotCreated
232
+ next
233
+ end
234
+
235
+ b2.use ConnectLibvirt
236
+ b2.use Call, IsRunning do |env2, b3|
237
+ if !env2[:result]
238
+ b3.use MessageNotRunning
239
+ next
240
+ end
241
+
242
+ b3.use SSHRun
243
+ end
244
+ end
245
+
246
+ end
247
+ end
248
+
249
+
224
250
  action_root = Pathname.new(File.expand_path("../action", __FILE__))
225
251
  autoload :ConnectLibvirt, action_root.join("connect_libvirt")
226
252
  autoload :IsCreated, action_root.join("is_created")
@@ -231,6 +257,7 @@ module VagrantPlugins
231
257
  autoload :MessageNotRunning, action_root.join("message_not_running")
232
258
  autoload :MessageNotSuspended, action_root.join("message_not_suspended")
233
259
  autoload :HandleStoragePool, action_root.join("handle_storage_pool")
260
+ autoload :HandleBoxUrl, "vagrant/action/builtin/handle_box_url"
234
261
  autoload :HandleBoxImage, action_root.join("handle_box_image")
235
262
  autoload :SetNameOfDomain, action_root.join("set_name_of_domain")
236
263
  autoload :CreateDomainVolume, action_root.join("create_domain_volume")
@@ -247,6 +274,7 @@ module VagrantPlugins
247
274
  autoload :TimedProvision, action_root.join("timed_provision")
248
275
  autoload :WaitTillUp, action_root.join("wait_till_up")
249
276
  autoload :SyncFolders, action_root.join("sync_folders")
277
+ autoload :SSHRun, "vagrant/action/builtin/ssh_run"
250
278
  end
251
279
  end
252
280
  end
@@ -48,6 +48,10 @@ module VagrantPlugins
48
48
 
49
49
 
50
50
  # Fog libvirt exceptions
51
+ class FogError < VagrantLibvirtError
52
+ error_key(:fog_error)
53
+ end
54
+
51
55
  class FogLibvirtConnectionError < VagrantLibvirtError
52
56
  error_key(:fog_libvirt_connection_error)
53
57
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Libvirt
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-libvirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-11 00:00:00.000000000 Z
12
+ date: 2013-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog