right_agent 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -322,6 +322,7 @@ module RightScale
322
322
  elsif windows?
323
323
  res = Platform.const_get(const_name).new
324
324
  end
325
+ self.instance_variable_set(instance_var, res)
325
326
  end
326
327
  return res
327
328
  end
@@ -253,7 +253,7 @@ module RightScale
253
253
  results = []
254
254
  output_text.each do |line|
255
255
  volume = {}
256
- line_regex = /^([\/a-z0-9]+):(.*)/
256
+ line_regex = /^([\/a-z0-9_\-\.]+):(.*)/
257
257
  volmatch = line_regex.match(line)
258
258
  raise ParserError.new("Failed to parse volume info from #{line.inspect} using #{line_regex.inspect}") unless volmatch
259
259
  volume[:device] = volmatch[1]
data/right_agent.gemspec CHANGED
@@ -24,8 +24,8 @@ require 'rubygems'
24
24
 
25
25
  Gem::Specification.new do |spec|
26
26
  spec.name = 'right_agent'
27
- spec.version = '0.9.8'
28
- spec.date = '2012-04-04'
27
+ spec.version = '0.9.9'
28
+ spec.date = '2012-04-05'
29
29
  spec.authors = ['Lee Kirchhoff', 'Raphael Simon', 'Tony Spataro']
30
30
  spec.email = 'lee@rightscale.com'
31
31
  spec.homepage = 'https://github.com/rightscale/right_agent'
@@ -47,6 +47,30 @@ EOF
47
47
  @platform.volume_manager.parse_volumes(blkid_resp).should == volume_hash_ary
48
48
  end
49
49
 
50
+ it 'can parse volumes with hyphens or underscores (lvm use case)' do
51
+ blkid_resp = <<EOF
52
+ /dev/vg-rightscale-data_storage1/lvol0: UUID="ee34706d-866f-476e-9da4-6a18745456a4" TYPE="xfs"
53
+ EOF
54
+
55
+ volume_hash_ary = [
56
+ {:device => '/dev/vg-rightscale-data_storage1/lvol0', :uuid => 'ee34706d-866f-476e-9da4-6a18745456a4', :type => 'xfs', :filesystem => "xfs"}
57
+ ]
58
+
59
+ @platform.volume_manager.parse_volumes(blkid_resp).should == volume_hash_ary
60
+ end
61
+
62
+ it 'can parse volumes with periods' do
63
+ blkid_resp = <<EOF
64
+ /dev/please.dont.do.this: UUID="ee34706d-866f-476e-9da4-6a18745456a4" TYPE="xfs"
65
+ EOF
66
+
67
+ volume_hash_ary = [
68
+ {:device => '/dev/please.dont.do.this', :uuid => 'ee34706d-866f-476e-9da4-6a18745456a4', :type => 'xfs', :filesystem => "xfs"}
69
+ ]
70
+
71
+ @platform.volume_manager.parse_volumes(blkid_resp).should == volume_hash_ary
72
+ end
73
+
50
74
  it 'raises a parser error when blkid output is malformed' do
51
75
  blkid_resp = 'foobarbz'
52
76
 
@@ -100,9 +124,8 @@ EOF
100
124
  proc on /proc type proc (rw,noexec,nosuid,nodev)
101
125
  EOF
102
126
 
103
- mount_popen_mock = flexmock(:read => mount_resp)
104
- flexmock(IO).should_receive(:popen).with('mount',Proc).once.and_yield(mount_popen_mock)
105
- flexmock(IO).should_receive(:popen).with('mount -t vfat /dev/xvdh1 /var/spool/softlayer',Proc).once.and_yield(flexmock(:read => ""))
127
+ flexmock(@platform.volume_manager).should_receive(:blocking_popen).with('mount').once.and_return([0, mount_resp])
128
+ flexmock(@platform.volume_manager).should_receive(:blocking_popen).with('mount -t vfat /dev/xvdh1 /var/spool/softlayer').once.and_return([0, '']);
106
129
 
107
130
  @platform.volume_manager.mount_volume({:device => "/dev/xvdh1", :filesystem => "vfat"}, "/var/spool/softlayer")
108
131
  end
@@ -113,10 +136,8 @@ EOF
113
136
  proc on /proc type proc (rw,noexec,nosuid,nodev)
114
137
  /dev/xvdh1 on /var/spool/softlayer type vfat (rw) [METADATA]
115
138
  EOF
116
-
117
- mount_popen_mock = flexmock(:read => mount_resp)
118
- flexmock(IO).should_receive(:popen).with('mount',Proc).once.and_yield(mount_popen_mock)
119
- flexmock(IO).should_receive(:popen).with('mount -t vfat /dev/xvdh1 /var/spool/softlayer',Proc).never.and_yield(flexmock(:read => ""))
139
+ flexmock(@platform.volume_manager).should_receive(:blocking_popen).with('mount').once.and_return([0, mount_resp])
140
+ flexmock(@platform.volume_manager).should_receive(:blocking_popen).with('mount -t vfat /dev/xvdh1 /var/spool/softlayer').never.and_return([0, '']);
120
141
 
121
142
  @platform.volume_manager.mount_volume({:device => "/dev/xvdh1", :filesystem => "vfat"}, "/var/spool/softlayer")
122
143
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_agent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 41
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 8
10
- version: 0.9.8
9
+ - 9
10
+ version: 0.9.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lee Kirchhoff
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-04-04 00:00:00 -07:00
20
+ date: 2012-04-05 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency