misc: Fix typos and spelling errors

This commit is contained in:
Edward Toroshchyn
2025-02-24 15:59:00 +01:00
parent 1f90de31e7
commit c25a2a257b
40 changed files with 62 additions and 62 deletions

View File

@@ -56,7 +56,7 @@ func AutoEdge(graph *pgraph.Graph, debug bool, logf func(format string, v ...int
sorted = append(sorted, res)
}
for _, res := range sorted { // for each vertexes autoedges
for _, res := range sorted { // for each vertices autoedges
autoEdgeObj, e := res.AutoEdges()
if e != nil {
err = errwrap.Append(err, e) // collect all errors

View File

@@ -301,7 +301,7 @@ Loop:
// check edges
for v1 := range g1.Adjacency() { // for each vertex in g1
v2 := m[v1] // lookup in map to get correspondance
v2 := m[v1] // lookup in map to get correspondence
// g1.Adjacency()[v1] corresponds to g2.Adjacency()[v2]
if e1, e2 := len(g1.Adjacency()[v1]), len(g2.Adjacency()[v2]); e1 != e2 {
r1 := v1.(engine.Res)

View File

@@ -134,7 +134,7 @@ func (ag *baseGrouper) VertexNext() (v1, v2 pgraph.Vertex, err error) {
return
}
// VertexCmp can be used in addition to an overridding implementation.
// VertexCmp can be used in addition to an overriding implementation.
func (ag *baseGrouper) VertexCmp(v1, v2 pgraph.Vertex) error {
if v1 == nil || v2 == nil {
return fmt.Errorf("the vertex is nil")

View File

@@ -228,7 +228,7 @@ func (obj *State) Init() error {
if !ok {
continue
}
// pass in information on requestor...
// pass in information on requester...
if err := r1.GraphQueryAllowed(
engine.GraphQueryableOptionKind(res.Kind()),
engine.GraphQueryableOptionName(res.Name()),
@@ -243,7 +243,7 @@ func (obj *State) Init() error {
if !ok {
continue
}
// pass in information on requestor...
// pass in information on requester...
if err := r2.GraphQueryAllowed(
engine.GraphQueryableOptionKind(res.Kind()),
engine.GraphQueryableOptionName(res.Name()),

View File

@@ -150,7 +150,7 @@ func (obj *MetaParams) Cmp(meta *MetaParams) error {
// XXX: add a one way cmp like we used to have ?
//if obj.Noop != meta.Noop {
// // obj is the existing res, res is the *new* resource
// // if we go from no-noop -> noop, we can re-use the obj
// // if we go from no-noop -> noop, we can reuse the obj
// // if we go from noop -> no-noop, we need to regenerate
// if obj.Noop { // asymmetrical
// return fmt.Errorf("values for Noop are different") // going from noop to no-noop!

View File

@@ -193,7 +193,7 @@ type AwsEc2Res struct {
// UserData is used to run bash and cloud-init commands on first launch.
// See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
// for documantation and examples.
// for documentation and examples.
UserData string `lang:"userdata" yaml:"userdata"`
client *ec2.EC2 // client session for AWS API calls

View File

@@ -142,7 +142,7 @@ type CronRes struct {
WakeSystem bool `lang:"wakesystem" yaml:"wakesystem"`
// RemainAfterElapse, if true, means an elapsed timer will stay loaded,
// and its state remains queriable. If false, an elapsed timer unit that
// and its state remains queryable. If false, an elapsed timer unit that
// cannot elapse anymore is unloaded. It defaults to true.
RemainAfterElapse bool `lang:"remainafterelapse" yaml:"remainafterelapse"`
@@ -271,7 +271,7 @@ func (obj *CronRes) Watch(ctx context.Context) error {
//args = append(args, "eavesdrop='true'") // XXX: not allowed anymore?
args = append(args, fmt.Sprintf("arg2='%s.timer'", obj.Name()))
// match dbus messsages
// match dbus messages
if call := bus.BusObject().Call(engineUtil.DBusAddMatch, 0, strings.Join(args, ",")); call.Err != nil {
return call.Err
}

View File

@@ -1863,7 +1863,7 @@ func (obj *DHCPRangeRes) handler4(data *HostData) (func(*dhcpv4.DHCPv4, *dhcpv4.
// FIXME: Run this somewhere for now, eventually it should get scheduled
// to run in the returned duration of time. This way, it would clean old
// peristed entries when they're stale, not when a new request comes in.
// persisted entries when they're stale, not when a new request comes in.
if _, err := obj.leaseClean(); err != nil {
return nil, errwrap.Wrapf(err, "clean error")
}

View File

@@ -407,7 +407,7 @@ func (obj *DockerContainerRes) Cmp(r engine.Res) error {
return errwrap.Wrapf(err, "the Cmd field differs")
}
if err := util.SortedStrSliceCompare(obj.Env, res.Env); err != nil {
return errwrap.Wrapf(err, "tne Env field differs")
return errwrap.Wrapf(err, "the Env field differs")
}
if len(obj.Ports) != len(res.Ports) {
return fmt.Errorf("the Ports length differs")
@@ -461,7 +461,7 @@ func (obj *DockerContainerRes) AutoEdges() (engine.AutoEdge, error) {
}, nil
}
// Next returnes the next automatic edge.
// Next returns the next automatic edge.
func (obj *DockerContainerResAutoEdges) Next() []engine.ResUID {
if len(obj.UIDs) == 0 {
return nil

View File

@@ -145,7 +145,7 @@ type FileRes struct {
// Source specifies the source contents for the file resource. It cannot
// be combined with the Content or Fragments parameters. It must be an
// absolute path, and it can point to a file or a directory. If it
// points to a file, then that will will be copied throuh directly. If
// points to a file, then that will will be copied through directly. If
// it points to a directory, then it will copy the directory "rsync
// style" onto the file destination. As a result, if this is a file,
// then the main file res must be a file, and if it is a directory, then
@@ -643,7 +643,7 @@ func (obj *FileRes) fileCheckApply(ctx context.Context, apply bool, src io.ReadS
return "", false, err
}
sha256sum = hex.EncodeToString(hash.Sum(nil))
// since we re-use this src handler below, it is
// since we reuse this src handler below, it is
// *critical* to seek to 0, or we'll copy nothing!
if n, err := src.Seek(0, 0); err != nil || n != 0 {
return sha256sum, false, err
@@ -673,7 +673,7 @@ func (obj *FileRes) fileCheckApply(ctx context.Context, apply bool, src io.ReadS
if err != nil {
return sha256sum, false, err
}
defer dstFile.Close() // TODO: is this redundant because of the earlier defered Close() ?
defer dstFile.Close() // TODO: is this redundant because of the earlier deferred Close() ?
if isFile { // set mode because it's a new file
if err := dstFile.Chmod(srcStat.Mode()); err != nil {

View File

@@ -46,7 +46,7 @@ func init() {
// PanicRes is a no-op resource that does nothing as quietly as possible. One of
// these will be added the graph if you use the panic function. (Even when it is
// in a non-panic mode.) This is possibly the simplest resource that exists, and
// in fact, everytime it is used, it will always have the same "name" value. It
// in fact, every time it is used, it will always have the same "name" value. It
// is only used so that there is a valid destination for the panic function.
type PanicRes struct {
traits.Base // add the base methods without re-implementation

View File

@@ -853,7 +853,7 @@ func (obj *VirtRes) CheckApply(ctx context.Context, apply bool) (bool, error) {
}
// FIXME: is doing this early check (therefore twice total) a good idea?
// run additional pre-emptive attr change checks here for hotplug stuff!
// run additional preemptive attr change checks here for hotplug stuff!
if !obj.absent {
if c, err := obj.attrCheckApply(ctx, apply, dom); err != nil {
return false, errwrap.Wrapf(err, "early attrCheckApply failed")

View File

@@ -69,7 +69,7 @@ func modeIsValidWhat(what string) bool {
return len(what) == 0
}
// modeAssigned executes an assigment symbolic mode string (u=r). It clears out
// modeAssigned executes an assignment symbolic mode string (u=r). It clears out
// any bits for every subject in who and then assigns the specified modes in
// what.
func modeAssigned(who, what string, from os.FileMode) (os.FileMode, error) {
@@ -208,7 +208,7 @@ func modeSubtracted(who, what string, from os.FileMode) (os.FileMode, error) {
}
// modeValueFrom will return the bits requested for the mode in the correct
// possitions for the specified subjects in who.
// positions for the specified subjects in who.
func modeValueFrom(who string, modeType uint32) os.FileMode {
i := uint32(0)
for _, w := range who {

View File

@@ -51,7 +51,7 @@ import (
)
const (
// DBusInterface is the dbus interface that contains genereal methods.
// DBusInterface is the dbus interface that contains general methods.
DBusInterface = "org.freedesktop.DBus"
// DBusAddMatch is the dbus method to receive a subset of dbus broadcast
// signals.
@@ -387,7 +387,7 @@ func GetGID(group string) (int, error) {
return -1, errwrap.Wrapf(err, "group lookup error (%s)", group)
}
// RestartUnit resarts the given dbus unit and waits for it to finish starting.
// RestartUnit restarts the given dbus unit and waits for it to finish starting.
func RestartUnit(ctx context.Context, conn *dbus.Conn, unit string) error {
return unitStateAction(ctx, conn, unit, DBusRestartUnit)
}