Changes for windows + ssh protocol support

This commit is contained in:
Mukta Aphale 2013-06-14 05:55:58 +05:30
Родитель cd9d28993a
Коммит f6b2ce0e23
2 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -448,11 +448,20 @@ class Chef
if is_image_windows?
server_def[:os_type] = 'Windows'
if not locate_config_value(:winrm_password) or not locate_config_value(:bootstrap_protocol)
ui.error("WinRM Password and Bootstrapping Protocol are compulsory parameters")
server_def[:bootstrap_proto] = locate_config_value(:bootstrap_protocol)
if locate_config_value(:bootstrap_protocol) == 'winrm'
unless locate_config_value(:winrm_password)
ui.error("WinRM Password is compulsory parameter")
exit 1
end
server_def[:admin_password] = locate_config_value(:winrm_password)
server_def[:bootstrap_proto] = locate_config_value(:bootstrap_protocol)
else
unless locate_config_value(:ssh_password)
ui.error("SSH Password is compulsory parameter for windows image")
exit 1
end
server_def[:admin_password] = locate_config_value(:ssh_password)
end
else
server_def[:os_type] = 'Linux'
server_def[:bootstrap_proto] = 'ssh'

Просмотреть файл

@ -283,7 +283,7 @@ describe "for bootstrap protocol ssh:" do
context "windows instance:" do
it "successful bootstrap" do
pending "OC-8384-support ssh for windows vm's in knife-azure"
#pending "OC-8384-support ssh for windows vm's in knife-azure"
@server_instance.should_receive(:is_image_windows?).exactly(3).times.and_return(true)
@bootstrap = Chef::Knife::BootstrapWindowsSsh.new
Chef::Knife::BootstrapWindowsSsh.stub(:new).and_return(@bootstrap)