From cd6646e80cfadba46fccd920495b9a9398c3cf54 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Fri, 16 Dec 2016 11:43:36 -0500 Subject: [PATCH] Merge pull request #13209 from kbrock/fix_auth_drb fix_auth: allow config tables to have drb models (cherry picked from commit 64d9f44de675d7980ca8d0d4ecc129044d7833b5) https://bugzilla.redhat.com/show_bug.cgi?id=1434158 --- tools/fix_auth.rb | 3 +++ tools/fix_auth/auth_config_model.rb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tools/fix_auth.rb b/tools/fix_auth.rb index dfecea6edf4..c873405ed9e 100755 --- a/tools/fix_auth.rb +++ b/tools/fix_auth.rb @@ -13,6 +13,9 @@ require 'active_support/all' require 'active_support/concern' +# this gets around a bug if a user mistakingly +# serializes a drb object into a configuration hash +require 'drb' require_relative '../lib/vmdb/settings/walker' require 'fix_auth/auth_model' require 'fix_auth/auth_config_model' diff --git a/tools/fix_auth/auth_config_model.rb b/tools/fix_auth/auth_config_model.rb index b947df4a161..c07a9223914 100644 --- a/tools/fix_auth/auth_config_model.rb +++ b/tools/fix_auth/auth_config_model.rb @@ -41,6 +41,10 @@ def recrypt(old_value, options = {}) symbol_keys ? hash.deep_symbolize_keys! : hash.deep_stringify_keys! hash.to_yaml + rescue ArgumentError # undefined class/module + puts "potentially bad yaml:" + puts old_value + raise end end end