Class: NIFTY::Cloud::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/knife-nc/nifty_cloud_sdk_extensions.rb

Instance Method Summary collapse

Instance Method Details

#original_response_generatorObject



22
# File 'lib/knife-nc/nifty_cloud_sdk_extensions.rb', line 22

alias original_response_generator response_generator

#original_run_instancesObject



21
# File 'lib/knife-nc/nifty_cloud_sdk_extensions.rb', line 21

alias original_run_instances run_instances

#response_generator(params) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/knife-nc/nifty_cloud_sdk_extensions.rb', line 29

def response_generator(params)
  params.delete('Password') if params['Password'] == 'ignoreme'
  if @user_data
    params['UserData'] = extract_user_data(:user_data => @user_data, :base64_encoded => true)
    params['UserData.Encoding'] = 'base64'
  end
  original_response_generator(params)
end

#run_instances(options) ⇒ Object



23
24
25
26
27
# File 'lib/knife-nc/nifty_cloud_sdk_extensions.rb', line 23

def run_instances(options)
  options[:password] = 'ignoreme' unless options[:password]
  @user_data = options[:user_data]
  original_run_instances(options)
end