From ae10786d143c247e9cd868cdbf5a1cb2ef9384b5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 5 Jun 2024 11:47:35 +0200 Subject: [PATCH] don't run restorecon before restoring a backup --- .../procedures/selinux/set_file_security.rb | 25 ------------------- definitions/scenarios/restore.rb | 4 --- 2 files changed, 29 deletions(-) delete mode 100644 definitions/procedures/selinux/set_file_security.rb diff --git a/definitions/procedures/selinux/set_file_security.rb b/definitions/procedures/selinux/set_file_security.rb deleted file mode 100644 index c711f345e..000000000 --- a/definitions/procedures/selinux/set_file_security.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Procedures::Selinux - class SetFileSecurity < ForemanMaintain::Procedure - metadata do - description 'Setting file security' - - param :incremental_backup, - 'Is the backup incremental?', - :required => true - manual_detection - confine do - File.directory?('/sys/fs/selinux') - end - end - - def run - with_spinner('Restoring SELinux context') do |spinner| - if @incremental_backup - spinner.update('Skipping for incremental update') - else - execute!('restorecon -Rn /') - end - end - end - end -end diff --git a/definitions/scenarios/restore.rb b/definitions/scenarios/restore.rb index 7981090fc..18131d1bf 100644 --- a/definitions/scenarios/restore.rb +++ b/definitions/scenarios/restore.rb @@ -27,7 +27,6 @@ def compose end add_steps_with_context(Procedures::Restore::Confirmation, - Procedures::Selinux::SetFileSecurity, Procedures::Restore::RequiredPackages, Procedures::Restore::Configs) add_step_with_context(Procedures::Crond::Stop) if feature(:cron) @@ -89,9 +88,6 @@ def set_context_mapping Procedures::Restore::ForemanDump => :backup_dir, Procedures::Restore::PulpcoreDump => :backup_dir, Procedures::Restore::ExtractFiles => :backup_dir) - - context.map(:incremental_backup, - Procedures::Selinux::SetFileSecurity => :incremental_backup) end end