Remove unused str2hash
Change-Id: I9732ccbdafa79b11d8cb4955381794b922e16385
This commit is contained in:
parent
0ce7d9fe9e
commit
599703b530
|
@ -124,14 +124,4 @@ class Puppet::Provider::Nova < Puppet::Provider::Openstack
|
|||
@nova_conf = nil
|
||||
@nova_credentials = nil
|
||||
end
|
||||
|
||||
def self.str2hash(s)
|
||||
#parse string
|
||||
if s.include? "="
|
||||
k, v = s.split("=", 2)
|
||||
return {k.gsub(/'/, "") => v.gsub(/'/, "")}
|
||||
else
|
||||
return s.gsub(/'/, "")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -64,31 +64,4 @@ describe Puppet::Provider::Nova do
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'when parse a string line' do
|
||||
it 'should return the same string' do
|
||||
res = klass.str2hash("zone1")
|
||||
expect(res).to eq("zone1")
|
||||
end
|
||||
|
||||
it 'should return the string without quotes' do
|
||||
res = klass.str2hash("'zone1'")
|
||||
expect(res).to eq("zone1")
|
||||
end
|
||||
|
||||
it 'should return the same string' do
|
||||
res = klass.str2hash("z o n e1")
|
||||
expect(res).to eq("z o n e1")
|
||||
end
|
||||
|
||||
it 'should return a hash' do
|
||||
res = klass.str2hash("a=b")
|
||||
expect(res).to eq({"a"=>"b"})
|
||||
end
|
||||
|
||||
it 'should return a hash with containing spaces' do
|
||||
res = klass.str2hash("a b = c d")
|
||||
expect(res).to eq({"a b "=>" c d"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue