lxd/db/node.go
func (c *ClusterTx) NodeByName(name string) (NodeInfo, error) {
	null := NodeInfo{}
	nodes, err := c.nodes(false /* not pending */, "name=?", name)
	if err != nil {
		return null, err
	}
	switch len(nodes) {
	case 0:
		return null, ErrNoSuchObject
	case 1:
		return nodes[0], nil
	default:
		return null, fmt.Errorf("more than one node matches")
	}
}
func (c *ClusterTx) NodeByName(name string) (NodeInfo, error) {
	null := NodeInfo{}
	nodes, err := c.nodes(false /* not pending */, "name=?", name)
	if err != nil {
		return null, err
	}
	switch len(nodes) {
	case 0:
		return null, ErrNoSuchObject
	case 1:
		return nodes[0], nil
	default:
		return null, fmt.Errorf("more than one node matches")
	}
}
func ( c * ClusterTx ) NodeByName ( name string ) ( NodeInfo , error ) { null := NodeInfo { } nodes , err := c . nodes ( false /* not pending */ , " " , name ) if err != nil { return null , err } switch len ( nodes ) { case 0 : return null , ErrNoSuchObject case 1 : return nodes [ 0 ] , nil default : return null , fmt . Errorf ( " " ) } }
// NodeByName returns the node with the given name.
NodeByName returns the node with the given name .