Class: Wordmove::Actions::Ssh::CleanupAfterAdapt
- Inherits:
-
Object
- Object
- Wordmove::Actions::Ssh::CleanupAfterAdapt
- Extended by:
- LightService::Action
- Includes:
- Helpers
- Defined in:
- lib/wordmove/actions/ssh/cleanup_after_adapt.rb
Overview
Cleanup file created during DB push/pull operations
Class Method Summary collapse
-
.execute ⇒ LightService::Context
Action’s context.
Class Method Details
.execute ⇒ LightService::Context
Returns Action’s context.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/wordmove/actions/ssh/cleanup_after_adapt.rb', line 19 executed do |context| # rubocop:disable Metrics/BlockLength context.logger.task 'Cleanup' if simulate?(cli_options: context.) context.logger.info 'No cleanup during simulation' next context end result = Wordmove::Actions::DeleteLocalFile.execute( logger: context.logger, cli_options: context., file_path: context.db_paths.local.path ) if result.failure? context.logger.warning 'Failed to delete local file ' \ "#{context.db_paths.local.path} because: " \ "#{result.}" \ '. Manual intervention required' end result = Wordmove::Actions::DeleteLocalFile.execute( cli_options: context., logger: context.logger, file_path: context.db_paths.local.gzipped_adapted_path ) if result.failure? context.logger.warning 'Failed to delete local file ' \ "#{context.db_paths.local.gzipped_adapted_path} because: " \ "#{result.}" \ '. Manual intervention required' end end |