Skip to content

Commit

Permalink
Remove the executor named parameter from constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Aug 9, 2022
1 parent 7f0308f commit f08bd33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/factsengine/gatherers/saphostctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const (
)

type SapHostCtrlGatherer struct {
executor CommandExecutor
CommandExecutor
}

func NewSapHostCtrlGatherer() *SapHostCtrlGatherer {
return &SapHostCtrlGatherer{
executor: Executor{},
Executor{},
}
}

Expand All @@ -24,7 +24,7 @@ func (g *SapHostCtrlGatherer) Gather(factsRequests []FactRequest) ([]Fact, error

for _, factReq := range factsRequests {
// TODO: The instance number "00" could be an additional argument in the future
version, err := g.executor.Exec(
version, err := g.Exec(
"/usr/sap/hostctrl/exe/saphostctrl", "-nr", "00", "-function", factReq.Argument)
if err != nil {
// TODO: Decide together with Wanda how to deal with errors. `err` field in the fact result?
Expand Down
4 changes: 2 additions & 2 deletions internal/factsengine/gatherers/saphostctrl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (suite *SapHostCtrlTestSuite) TestSapHostCtrlGather() {
[]byte("ERROR"), nil)

p := &SapHostCtrlGatherer{
executor: mockExecutor,
mockExecutor,
}

factRequests := []FactRequest{
Expand Down Expand Up @@ -71,7 +71,7 @@ func (suite *SapHostCtrlTestSuite) TestSapHostCtrlGatherError() {
[]byte("some error"), errors.New("some error"))

p := &SapHostCtrlGatherer{
executor: mockExecutor,
mockExecutor,
}

factRequests := []FactRequest{
Expand Down

0 comments on commit f08bd33

Please sign in to comment.