// SubmitCommand creates a new command for a particular nodeId, the
// command has a random name and is added to the particular nodeId
// directory in etcd.
SubmitCommand creates a new command for a particular nodeId, the
command has a random name and is added to the particular nodeId
directory in etcd.
// SubmitCommand creates a new command for a particular nodeId the // command has a random name and is added to the particular nodeId // directory in etcd .
func (mc *mclient) SubmitCommand(node string, command metafora.Command) error {
	cmdPath := mc.cmdPath(node)
	body, err := command.Marshal()
	if err != nil {
		return err
	}
	key := path.Join(cmdPath, strconv.FormatUint(rand.Uint64(), 10))
	if _, err := mc.kvc.Put(context.Background(), key, string(body)); err != nil {
		metafora.Errorf("Error submitting command: %s to node: %s", command, node)
		return err
	}
	metafora.Debugf("Submitted command: %s to node: %s", string(body), node)
	return nil
}
func ( mc * mclient ) SubmitCommand ( node string , command metafora . Command ) error { cmdPath := mc . cmdPath ( node ) body , err := command . Marshal ( ) if err != nil { return err } key := path . Join ( cmdPath , strconv . FormatUint ( rand . Uint64 ( ) , 10 ) ) if _ , err := mc . kvc . Put ( context . Background ( ) , key , string ( body ) ) ; err != nil { metafora . Errorf ( " " , command , node ) return err } metafora . Debugf ( " " , string ( body ) , node ) return nil }
SubmitCommand creates a new command for a particular nodeId, the
command has a random name and is added to the particular nodeId
directory in etcd.
SubmitCommand creates a new command for a particular nodeId the command has a random name and is added to the particular nodeId directory in etcd .
// This is either a bug in metafora or someone implemented their own // command incorrectly.