Class: Cloudkeeper::Managers::ImageListManager
- Inherits:
-
Object
- Object
- Cloudkeeper::Managers::ImageListManager
- Defined in:
- lib/cloudkeeper/managers/image_list_manager.rb
Instance Attribute Summary collapse
-
#image_list ⇒ Object
readonly
Returns the value of attribute image_list.
-
#openssl_store ⇒ Object
readonly
Returns the value of attribute openssl_store.
Instance Method Summary collapse
- #download_image_list ⇒ Object
-
#initialize ⇒ ImageListManager
constructor
A new instance of ImageListManager.
Constructor Details
#initialize ⇒ ImageListManager
Returns a new instance of ImageListManager.
11 12 13 14 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 11 def initialize @openssl_store = OpenSSL::X509::Store.new @openssl_store.add_path Cloudkeeper::Settings[:'ca-dir'] if Cloudkeeper::Settings[:'ca-dir'] end |
Instance Attribute Details
#image_list ⇒ Object (readonly)
Returns the value of attribute image_list.
9 10 11 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 9 def image_list @image_list end |
#openssl_store ⇒ Object (readonly)
Returns the value of attribute openssl_store.
9 10 11 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 9 def openssl_store @openssl_store end |
Instance Method Details
#download_image_list ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 16 def download_image_list logger.debug 'Downloading fresh image lists...' url = Cloudkeeper::Settings[:'image-list'] Dir.mktmpdir('cloudkeeper') { |dir| retrieve_image_list url, dir } rescue Cloudkeeper::Errors::ImageList::DownloadError, Cloudkeeper::Errors::ImageList::VerificationError, Cloudkeeper::Errors::Parsing::ParsingError, OpenSSL::PKCS7::PKCS7Error, JSON::ParserError => ex raise Cloudkeeper::Errors::ImageList::ImageListError, "Image list #{url.inspect} couldn't be downloaded\n#{ex.}" end |