2015-08-11 19:47:54 +03:00
|
|
|
require "commands/knife_commands"
|
|
|
|
|
|
|
|
|
|
class KnifeFactory
|
|
|
|
|
|
2015-08-12 11:37:17 +03:00
|
|
|
@instance = nil
|
2015-08-11 19:47:54 +03:00
|
|
|
class << self
|
2015-08-12 11:37:17 +03:00
|
|
|
attr_accessor :instance
|
2015-08-11 19:47:54 +03:00
|
|
|
def init
|
2015-08-12 09:41:19 +03:00
|
|
|
c = DevopsConfig.config[:knife_config_file]
|
|
|
|
|
raise "Option ':knife_config_file' is undefined, please check config.rb file" unless c
|
2015-08-11 19:47:54 +03:00
|
|
|
@instance = KnifeCommands.new(c)
|
2015-08-12 11:37:17 +03:00
|
|
|
DevopsLogger.logger.info("Knife instance has been initialized")
|
2015-08-11 19:47:54 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|