Class: Cloudkeeper::Managers::ImageListManager
- Inherits:
-
Object
- Object
- Cloudkeeper::Managers::ImageListManager
- Defined in:
- lib/cloudkeeper/managers/image_list_manager.rb
Instance Attribute Summary collapse
-
#image_lists ⇒ Object
readonly
Returns the value of attribute image_lists.
-
#openssl_store ⇒ Object
readonly
Returns the value of attribute openssl_store.
Instance Method Summary collapse
- #download_image_lists ⇒ Object
-
#initialize ⇒ ImageListManager
constructor
A new instance of ImageListManager.
Constructor Details
#initialize ⇒ ImageListManager
Returns a new instance of ImageListManager.
12 13 14 15 16 17 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 12 def initialize @image_lists = {} @openssl_store = OpenSSL::X509::Store.new @openssl_store.add_path Cloudkeeper::Settings[:'ca-dir'] if Cloudkeeper::Settings[:'ca-dir'] end |
Instance Attribute Details
#image_lists ⇒ Object (readonly)
Returns the value of attribute image_lists.
10 11 12 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 10 def image_lists @image_lists end |
#openssl_store ⇒ Object (readonly)
Returns the value of attribute openssl_store.
10 11 12 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 10 def openssl_store @openssl_store end |
Instance Method Details
#download_image_lists ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/cloudkeeper/managers/image_list_manager.rb', line 19 def download_image_lists logger.debug 'Downloading fresh image lists...' Dir.mktmpdir('cloudkeeper') do |dir| urls = Cloudkeeper::Settings[:'image-lists'] || File.read(Cloudkeeper::Settings[:'image-lists-file']).split("\n") retrieve_image_lists urls, dir end end |