7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/lvm/attributes.rb', line 7
def load(version, name)
cwd = File.dirname(__FILE__)
if version == "2.02.28"
version = "2.02.27"
elsif ((31..39).map { |x| "2.02.#{x}" }).include?(version)
version = "2.02.30"
end
file = File.join(cwd, "attributes", version, name)
begin
return YAML.load_file(file)
rescue Errno::ENOENT => e
raise ArgumentError.new("Unable to load lvm attributes [#{name}] for version [#{version}]. " \
"The version/object may not be supported or you may need to upgrade the di-ruby-lvm-attrib gem. Error [#{e.message}]")
end
end
|