Class: Berta::CommandExecutor
- Inherits:
-
Object
- Object
- Berta::CommandExecutor
- Defined in:
- lib/berta/command_executor.rb
Overview
Class for executing main berta commands
Class Method Summary collapse
-
.cleanup ⇒ Object
Function that performs clean up operation.
Class Method Details
.cleanup ⇒ Object
Function that performs clean up operation. Connects to opennebula database, runs expiration update process and notifies users about upcoming expirations.
8 9 10 11 12 13 14 15 16 |
# File 'lib/berta/command_executor.rb', line 8 def self.cleanup service = Berta::Service.new(Berta::Settings['opennebula']['secret'], Berta::Settings['opennebula']['endpoint']) vms = service.running_vms Berta::ExpirationManager.new.update_expirations(vms) Berta::NotificationManager.new(service).notify_users(vms) rescue Berta::Errors::BackendError => e logger.error e. end |