Exemplo n.º 1
0
Arquivo: client.go Projeto: vmware/vic
func SSHls(client *ssh.Client) ([]string, error) {
	defer trace.End(trace.Begin(""))

	ok, reply, err := client.SendRequest(msgs.ContainersReq, true, nil)
	if !ok || err != nil {
		return nil, fmt.Errorf("failed to get container IDs from remote: %s", err)
	}

	ids := msgs.ContainersMsg{}

	if err = ids.Unmarshal(reply); err != nil {
		log.Debugf("raw IDs response: %+v", reply)
		return nil, fmt.Errorf("failed to unmarshal ids from remote: %s", err)
	}

	return ids.IDs, nil
}