lvmsync 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -52,14 +52,21 @@ straight for the source code.
52
52
 
53
53
  ## Installation
54
54
 
55
- On the machine you're transferring from, you'll need have `dmsetup` and
56
- `ssh` installed and available on the PATH, and an installation of Ruby 1.8
57
- (or later). Then just copy the `lvmsync` script to somewhere in root's
58
- PATH.
59
-
60
- On the machine you're transferring *to*, you'll need `sshd` installed and
61
- available for connection, and an installation of Ruby 1.8 (or later). Then
62
- just copy the `lvmsync` script to somewhere in root's PATH.
55
+ To run `lvmsync`, you'll need to have a working installation of Ruby 1.8 (or
56
+ later) on both the machine you're transferring from, and the machine you're
57
+ transferring to. On the source, you'll need `vgcfgbackup` (which is part of
58
+ the core LVM2 toolset), and if you want to deal with thin snapshots, you'll
59
+ also need `thin_dump` (which is part of the "thin provisioning tools" which
60
+ are highly recommended for anyone working with thin-provisioned LVs). For
61
+ transferring dumps between machines, you'll need SSH installed and working
62
+ between the two machines.
63
+
64
+ Installing `lvmsync` itself is easiest using Rubygems: `gem install
65
+ lvmsync`. This will install all the dependencies and (presumably) put the
66
+ `lvmsync` command itself in root's PATH. If for some reason you want to
67
+ install it all by hand, you'll need to copy the contents of `lib/` into a
68
+ directory in your Ruby library path, copy `bin/lvmsync` to somewhere on your
69
+ PATH, and install the `treetop` and `git-version-bump` gems.
63
70
 
64
71
 
65
72
  ## How do I use it?
data/lib/lvm/snapshot.rb CHANGED
@@ -108,6 +108,6 @@ class LVM::Snapshot
108
108
  end
109
109
 
110
110
  def metadata_device
111
- "/dev/mapper/#{@vg}-#{@lv}-cow"
111
+ "/dev/mapper/#{@vg}-#{@lv.gsub('-', '--')}-cow"
112
112
  end
113
113
  end
data/lib/lvm/vg_config.rb CHANGED
@@ -57,13 +57,16 @@ class LVM::VGConfig
57
57
  cmd = "#{@vgcfgbackup_cmd} -f #{tmpf.path} #{@vg_name}"
58
58
  stdout = nil
59
59
  stderr = nil
60
- Open3.popen3(cmd) do |stdin_fd, stdout_fd, stderr_fd|
60
+ exit_status = nil
61
+
62
+ Open3.popen3(cmd) do |stdin_fd, stdout_fd, stderr_fd, wait_thr|
61
63
  stdin_fd.close
62
64
  stdout = stdout_fd.read
63
65
  stderr = stderr_fd.read
66
+ exit_status = wait_thr.value
64
67
  end
65
68
 
66
- if $?.exitstatus != 0
69
+ if exit_status.exitstatus != 0
67
70
  raise RuntimeError,
68
71
  "Failed to run vgcfgbackup: #{stdout}\n#{stderr}"
69
72
  end
@@ -8,7 +8,7 @@ grammar VgCfgBackup
8
8
  end
9
9
 
10
10
  rule variable_name
11
- [a-z0-9_]+ <VariableName>
11
+ [a-z0-9_-]+ <VariableName>
12
12
  end
13
13
 
14
14
  rule group
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lvmsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
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: 2014-05-23 00:00:00.000000000 Z
12
+ date: 2014-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: git-version-bump
@@ -221,7 +221,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
221
221
  version: '0'
222
222
  segments:
223
223
  - 0
224
- hash: -3361242777286472333
224
+ hash: 2970664606006248824
225
225
  required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  none: false
227
227
  requirements:
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  segments:
232
232
  - 0
233
- hash: -3361242777286472333
233
+ hash: 2970664606006248824
234
234
  requirements: []
235
235
  rubyforge_project:
236
236
  rubygems_version: 1.8.23