lib/nexussw/lxd.rb in lxd-common-0.9.8 vs lib/nexussw/lxd.rb in lxd-common-0.9.9

- old
+ new

@@ -1,6 +1,6 @@ -require 'timeout' +require "timeout" module NexusSW module LXD class ::Timeout::Retry < ::Timeout::Error def initialize(msg = nil) @@ -30,12 +30,17 @@ end def self.symbolize_keys(hash) {}.tap do |retval| hash.each do |k, v| - v.map! do |a| - a.is_a?(Hash) ? symbolize_keys(a) : a - end if v.is_a?(Array) + if %w{config expanded_config}.include? k + retval[k.to_sym] = v + next + elsif v.is_a?(Array) + v.map! do |a| + a.is_a?(Hash) ? symbolize_keys(a) : a + end + end retval[k.to_sym] = v.is_a?(Hash) ? symbolize_keys(v) : v end end end end