Skip to content

Commit 76ae383

Browse files
committed
[core] sending enabled links to DCS should require a lower-case var
It's a small bug, which required the users to use a variable `TOF_dcs_send_enabled_links` instead of `tof_dcs_send_enabled_links` to enable the feature brought in OCTRL-980. Now we require lower-case detector code. OCTRL-994
1 parent 54935c1 commit 76ae383

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

apricot/local/service_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,13 @@ var _ = Describe("local service", func() {
410410
Expect(err).To(HaveOccurred())
411411
})
412412
})
413+
When("retrieving the detector spelled lower-case for a host", func() {
414+
// not supported
415+
It("should produce an error", func() {
416+
detector, err = svc.GetDetectorForHost("abc")
417+
Expect(err).To(HaveOccurred())
418+
})
419+
})
413420
})
414421
Describe("getting detectors for hosts", func() {
415422
var (
@@ -550,6 +557,13 @@ var _ = Describe("local service", func() {
550557
Expect(err).To(HaveOccurred())
551558
})
552559
})
560+
When("retrieving the link IDs for a detector spelled lower-case", func() {
561+
// not supported
562+
It("should produce an error", func() {
563+
linkIDs, err = svc.GetAliasedLinkIDsForDetector("abc", false)
564+
Expect(err).To(HaveOccurred())
565+
})
566+
})
553567
When("retrieving the link IDs for a detector without readoutcard config", func() {
554568
It("should produce an error", func() {
555569
linkIDs, err = svc.GetAliasedLinkIDsForDetector("DEF", false)

core/integration/dcs/dcsutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func resolveDefaults(detectorArgMap map[string]string, varStack map[string]strin
5454
}
5555

5656
func addEnabledLinks(detectorArgMap map[string]string, varStack map[string]string, ecsDetector string, theLog *logrus.Entry) map[string]string {
57-
sendDetLinks, ok := varStack[ecsDetector+"_dcs_send_enabled_links"]
57+
sendDetLinks, ok := varStack[strings.ToLower(ecsDetector)+"_dcs_send_enabled_links"]
5858
if !ok || sendDetLinks != "true" {
5959
return detectorArgMap
6060
}

0 commit comments

Comments
 (0)