Class: Cloudkeeper::Managers::ApplianceManager
- Inherits:
-
Object
- Object
- Cloudkeeper::Managers::ApplianceManager
- Includes:
- Utils::Appliance
- Defined in:
- lib/cloudkeeper/managers/appliance_manager.rb
Constant Summary
Constants included from Utils::Appliance
Utils::Appliance::IMAGE_UPDATE_ATTRIBUTES
Instance Attribute Summary collapse
-
#acceptable_formats ⇒ Object
readonly
Returns the value of attribute acceptable_formats.
-
#backend_connector ⇒ Object
readonly
Returns the value of attribute backend_connector.
-
#image_list_manager ⇒ Object
readonly
Returns the value of attribute image_list_manager.
Instance Method Summary collapse
-
#initialize ⇒ ApplianceManager
constructor
A new instance of ApplianceManager.
- #synchronize_appliances ⇒ Object
Methods included from Utils::Appliance
#clean_image_file, #clean_image_files, #convert_image!, #log_expired, #prepare_image!, #update_appliance, #update_image?, #update_metadata?
Constructor Details
#initialize ⇒ ApplianceManager
Returns a new instance of ApplianceManager.
8 9 10 11 12 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 8 def initialize @backend_connector = Cloudkeeper::BackendConnector.new @image_list_manager = Cloudkeeper::Managers::ImageListManager.new @acceptable_formats = Cloudkeeper::Settings[:formats].map(&:to_sym) end |
Instance Attribute Details
#acceptable_formats ⇒ Object (readonly)
Returns the value of attribute acceptable_formats.
6 7 8 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 6 def acceptable_formats @acceptable_formats end |
#backend_connector ⇒ Object (readonly)
Returns the value of attribute backend_connector.
6 7 8 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 6 def backend_connector @backend_connector end |
#image_list_manager ⇒ Object (readonly)
Returns the value of attribute image_list_manager.
6 7 8 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 6 def image_list_manager @image_list_manager end |
Instance Method Details
#synchronize_appliances ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 14 def synchronize_appliances logger.debug 'Running appliance synchronization...' backend_connector.pre_action backend_image_lists = backend_connector.image_lists image_list_manager.download_image_lists sync_expired_image_lists sync_new_image_lists(backend_image_lists) sync_old_image_lists(backend_image_lists) backend_connector.post_action rescue Cloudkeeper::Errors::BackendError => ex abort ex. end |