Skip to content

Commit

Permalink
bugfix: make sure version is always a string
Browse files Browse the repository at this point in the history
  • Loading branch information
arlimus authored and srenatus committed Feb 22, 2016
1 parent a2f6627 commit 1147d30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/inspec/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ def self.symbolize_keys(hash)
end

def self.finalize(metadata, profile_id)
metadata.params['name'] = profile_id.to_s unless profile_id.to_s.empty?
metadata.params = symbolize_keys(metadata.params || {})
param = metadata.params || {}
param['name'] = profile_id.to_s unless profile_id.to_s.empty?
param['version'] = param['version'].to_s unless param['version'].nil?
metadata.params = symbolize_keys(param)
metadata
end

Expand Down

0 comments on commit 1147d30

Please sign in to comment.