示例#1
0
文件: pkg.go 项目: cheyang/scloud
func waitForReady(host *host.Host) error {
	fmt.Fprintf(os.Stderr, "Waiting for machine %s to be running, this may take a few minutes...\n", host.Name)

	if err := utils.WaitFor(drivers.MachineInState(host.Driver, state.Running)); err != nil {
		return fmt.Errorf("Error waiting for machine %s to be running: %s", host.Name, err)
	}

	fmt.Fprintf(os.Stderr, "Machine %s is running, waiting for SSH to be available ...\n", host.Name)

	if err := drivers.WaitForSSH(host.Driver); err != nil {
		return fmt.Errorf("Error waiting %s for SSH: %s", host.Name, err)
	}

	return nil
}
示例#2
0
			fmt.Println("PreCheck...", err)

			err = sl_driver.Create()

			//			real_driver.Id = 16407243

			fmt.Println("Create...", err)

			Expect(err).To(BeNil())

			if err != nil {
				fmt.Println("Create Error", err)
			}

			if err == nil {
				if err = utils.WaitFor(drivers.MachineInState(sl_driver, state.Running)); err != nil {
					fmt.Printf("Error waiting for machine %s to be running: %s\n", real_driver.MachineName, err)
				}
			}

			sshHostname, err := sl_driver.GetSSHHostname()

			fmt.Println(sshHostname)

			fmt.Println(err)

		})
	})
})