示例#1
0
文件: utils.go 项目: cheyang/scloud
func WaitForSSH(d Driver) error {
	if err := utils.WaitFor(sshAvailableFunc(d)); err != nil {
		fmt.Errorf("Too many retries waiting for SSH to be available.  Last error: %s", err)
	}

	return nil
}
示例#2
0
文件: list.go 项目: cheyang/scloud
func waitForReady(virtualGuestId int) error {
	fmt.Fprintf(os.Stderr, "Waiting for machine %d to be running, this may take a few minutes...\n", virtualGuestId)

	if err := utils.WaitFor(WaitForVirtualGuestToRunning(virtualGuestId)); err != nil {
		return fmt.Errorf("Error waiting for machine %d to be running: %s", virtualGuestId, err)
	}

	return nil
}
示例#3
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
}
示例#4
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)

		})
	})
})