Class: Cloudkeeper::Managers::ApplianceManager
- Inherits:
-
Object
- Object
- Cloudkeeper::Managers::ApplianceManager
- Defined in:
- lib/cloudkeeper/managers/appliance_manager.rb
Constant Summary collapse
- IMAGE_UPDATE_ATTRIBUTES =
['hv:version', 'sl:checksum:sha512', 'hv:size'].freeze
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
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.
4 5 6 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 4 def acceptable_formats @acceptable_formats end |
#backend_connector ⇒ Object (readonly)
Returns the value of attribute backend_connector.
4 5 6 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 4 def backend_connector @backend_connector end |
#image_list_manager ⇒ Object (readonly)
Returns the value of attribute image_list_manager.
4 5 6 |
# File 'lib/cloudkeeper/managers/appliance_manager.rb', line 4 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 |