Skip to content

Commit

Permalink
Addressing review feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
CDimonaco committed Jun 25, 2024
1 parent fa43179 commit 5c753ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/factsengine/gatherers/sapservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (s *SapServices) getSapServicesFileEntries() ([]SapServicesEntry, error) {
extractedSID, extractedInstance := extractInfoFromSystemdService(scannedLine)
if extractedSID == "" || extractedInstance == "" {
return nil, SapServicesParsingError.Wrap(
fmt.Sprintf("could not extract info from systemd SAP services entry: %s", scannedLine),
fmt.Sprintf("could not extract values from systemd SAP services entry: %s", scannedLine),
)
}

Expand All @@ -156,7 +156,7 @@ func (s *SapServices) getSapServicesFileEntries() ([]SapServicesEntry, error) {
extractedSID, extractedInstance := extractInfoFromSapstartService(scannedLine)
if extractedSID == "" || extractedInstance == "" {
return nil, SapServicesParsingError.Wrap(
fmt.Sprintf("could not extract info from sapstartsrv SAP services entry: %s", scannedLine),
fmt.Sprintf("could not extract values from sapstartsrv SAP services entry: %s", scannedLine),
)
}
sid = extractedSID
Expand Down
8 changes: 4 additions & 4 deletions internal/factsengine/gatherers/sapservices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ systemctl --no-ask-password start SAPS41_1
g := gatherers.NewSapServicesGatherer("/usr/sap/sapservices", tFs)
result, err := g.Gather(fr)
s.Nil(result)
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract info from systemd SAP services entry: systemctl --no-ask-password start SAPS41_0 ")
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract values from systemd SAP services entry: systemctl --no-ask-password start SAPS41_0 ")

}
func (s *SapServicesGathererSuite) TestSapServicesGathererSIDNotIdentifiedSystemd() {
Expand All @@ -77,7 +77,7 @@ systemctl --no-ask-password start SADS41_41
g := gatherers.NewSapServicesGatherer("/usr/sap/sapservices", tFs)
result, err := g.Gather(fr)
s.Nil(result)
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract info from systemd SAP services entry: systemctl --no-ask-password start SADS41_41")
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract values from systemd SAP services entry: systemctl --no-ask-password start SADS41_41")

}

Expand All @@ -102,7 +102,7 @@ LD_LIBRARY_PATH=/usr/sap/S41/D40/exe:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; /
g := gatherers.NewSapServicesGatherer("/usr/sap/sapservices", tFs)
result, err := g.Gather(fr)
s.Nil(result)
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract info from sapstartsrv SAP services entry: LD_LIBRARY_PATH=/usr/sap/HS1/HDB11/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/HS1/HDB11/exe/sapstartsrv pf=/usr/sap/HS1/SYS/profile/HS1HDB11_s41db -D -u hs1adm")
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract values from sapstartsrv SAP services entry: LD_LIBRARY_PATH=/usr/sap/HS1/HDB11/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/HS1/HDB11/exe/sapstartsrv pf=/usr/sap/HS1/SYS/profile/HS1HDB11_s41db -D -u hs1adm")
}

func (s *SapServicesGathererSuite) TestSapServicesGathererInstanceNotIdentifiedSapstart() {
Expand All @@ -126,7 +126,7 @@ LD_LIBRARY_PATH=/usr/sap/S41/D40/exe:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; /
g := gatherers.NewSapServicesGatherer("/usr/sap/sapservices", tFs)
result, err := g.Gather(fr)
s.Nil(result)
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract info from sapstartsrv SAP services entry: LD_LIBRARY_PATH=/usr/sap/HS1/HDB11/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/HS1/HDB11/exe/sapstartsrv pf=/usr/sap/HS1/SYS/profile/HS1_HDB1_s41db -D -u hs1adm")
s.EqualError(err, "fact gathering error: sap-services-parsing-error - error parsing the sapservices file: could not extract values from sapstartsrv SAP services entry: LD_LIBRARY_PATH=/usr/sap/HS1/HDB11/exe:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;/usr/sap/HS1/HDB11/exe/sapstartsrv pf=/usr/sap/HS1/SYS/profile/HS1_HDB1_s41db -D -u hs1adm")
}

func (s *SapServicesGathererSuite) TestSapServicesGathererSuccessSapstart() { //nolint:dupl
Expand Down

0 comments on commit 5c753ed

Please sign in to comment.