diff --git a/site-modules/profile/lib/facter/ceph_mgr_modules.rb b/site-modules/profile/lib/facter/ceph_mgr_modules.rb index 95842b0b..4dd70adb 100644 --- a/site-modules/profile/lib/facter/ceph_mgr_modules.rb +++ b/site-modules/profile/lib/facter/ceph_mgr_modules.rb @@ -1,9 +1,14 @@ require 'json' Facter.add('ceph_mgr_modules') do setcode do if File.exist?('/var/lib/ceph/mgr') - JSON.parse(Facter::Core::Execution.execute('ceph mgr module ls')) + data = Facter::Core::Execution.execute('ceph mgr module ls').strip + if data + JSON.parse(data) + else + {} + end end end end