Skip to content

Commit

Permalink
utils: fix up method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jun 17, 2022
1 parent d4c1661 commit f5639a4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions utils/dmidecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func NewDmidecode() (d *Dmidecode, err error) {
return &Dmidecode{dmi: dmi}, err
}

// InitFakeDmidecode Returns a fake dmidecode instance for tests
// given test data file returns a Dmidecode with the test dmidecode output loaded
// InitFakeDmidecode returns a fake dmidecode instance loaded with the dmidecode output from testFile
func InitFakeDmidecode(testFile string) (*Dmidecode, error) {
b, err := os.ReadFile(testFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion utils/mlxup.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewMlxupCmd(trace bool) *Mlxup {
return &Mlxup{Executor: e}
}

// Collect returns a slice of mellanox components as *common.NIC's
// NICs returns a slice of mellanox components as *common.NIC's
func (m *Mlxup) NICs(ctx context.Context) ([]*common.NIC, error) {
devices, err := m.Query()
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions utils/msecli.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type MsecliDevice struct {
FirmwareRevision string
}

// NewMsecli returns a Msecli object to run msecli commands
func NewMsecli(trace bool) *Msecli {
e := NewExecutor(msecliBin)
e.SetEnv([]string{"LC_ALL=C.UTF-8"})
Expand All @@ -42,7 +43,7 @@ func NewMsecli(trace bool) *Msecli {
return &Msecli{Executor: e}
}

// Components returns a slice of drive components identified
// Drives returns a slice of drive components identified
func (m *Msecli) Drives(ctx context.Context) ([]*common.Drive, error) {
devices, err := m.Query()
if err != nil {
Expand Down Expand Up @@ -71,7 +72,7 @@ func (m *Msecli) Drives(ctx context.Context) ([]*common.Drive, error) {
return drives, nil
}

// UpdateDrives installs drive updates
// UpdateDrive installs drive updates
func (m *Msecli) UpdateDrive(ctx context.Context, updateFile, modelNumber, serialNumber string) error {
// query list of drives
drives, err := m.Query()
Expand Down Expand Up @@ -118,7 +119,7 @@ func (m *Msecli) UpdateDrive(ctx context.Context, updateFile, modelNumber, seria
return ErrMseCliDriveNotIdentified
}

// update drive installs the given updatefile
// updateDrive installs the given updatefile
func (m *Msecli) updateDrive(ctx context.Context, modelNumber, updateFile string) error {
// echo 'y'
m.Executor.SetStdin(bytes.NewReader([]byte("y\n")))
Expand Down
2 changes: 1 addition & 1 deletion utils/smc_ipmicfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (i *Ipmicfg) BIOS(ctx context.Context) (*common.BIOS, error) {
}, nil
}

// CPLD returns a SMC CPLD component
// CPLDs returns a slice of SMC CPLD components
func (i Ipmicfg) CPLDs(ctx context.Context) ([]*common.CPLD, error) {
summary, err := i.Summary()
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion utils/storecli.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewFakeStoreCLI(r io.Reader) (*StoreCLI, error) {
}, nil
}

// Executes nvme list, parses the output and returns a slice of model.StorageControllers
// StorageControllers returns a slice of model.StorageControllers from the output of nvme list
func (s *StoreCLI) StorageControllers(ctx context.Context) ([]*common.StorageController, error) {
controllers := make([]*common.StorageController, 0)

Expand Down Expand Up @@ -108,6 +108,7 @@ func (s *StoreCLI) StorageControllers(ctx context.Context) ([]*common.StorageCon
return controllers, nil
}

// ShowController0 runs storecli to list controller 0
func (s *StoreCLI) ShowController0() ([]byte, error) {
// /opt/MegaRAID/storcli/storcli64 /c0 show J
s.Executor.SetArgs([]string{"/c0", "show", "J"})
Expand Down

0 comments on commit f5639a4

Please sign in to comment.