Class: ProconBypassMan::RemoteAction::RemotePbmJob::RestorePbmSettingAction
- Inherits:
-
BaseAction
- Object
- BaseAction
- ProconBypassMan::RemoteAction::RemotePbmJob::RestorePbmSettingAction
- Defined in:
- lib/procon_bypass_man/remote_action/remote_pbm_job/restore_pbm_setting.rb
Instance Attribute Summary
Attributes inherited from BaseAction
Instance Method Summary collapse
Methods inherited from BaseAction
Constructor Details
This class inherits a constructor from ProconBypassMan::RemoteAction::RemotePbmJob::BaseAction
Instance Method Details
#action_content(args:) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/procon_bypass_man/remote_action/remote_pbm_job/restore_pbm_setting.rb', line 6 def action_content(args: ) require "pbmenv" ProconBypassMan.logger.info "execute RestorePbmSettingAction!" setting = args.dig("setting") or raise(ProconBypassMan::RemotePbmJob::NeedPbmVersionError, "settingが必要です, #{args.inspect}") # 復元に失敗したら戻せるように退避する FileUtils.copy( ProconBypassMan..setting_path, ProconBypassMan.fallback_setting_path, ) ProconBypassMan::YamlWriter.write( path: ProconBypassMan..setting_path, content: setting, ) hot_reload! end |