Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ all: binaries
.PHONY: binaries
binaries: version $(BINARIES)

.PHONY: docker
.PHONY: container
container: version $(BINARIES)
$(DOCKER) build --tag openchami/bss:$(VERSION)-dirty $(DOCKEROPTS) .

Expand Down
20 changes: 12 additions & 8 deletions cmd/boot-script-service/boot_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,15 @@ func SqlGetBootParams(macs, xnames []string, nids []int32) (results []bssTypes.B
}

func StoreNew(bp bssTypes.BootParams) (error, string) {
// postgres.Add will handle duplicates, and it is called in New().
// Therefore, if Postgres is enabled, simply call Store().
// postgres.Add will handle duplicates.
if useSQL {
return Store(bp)
debugf("postgres.Add(%v)\n", bp)
if result, err := bssdb.Add(bp); err != nil {
return err, ""
} else {
debugf("postgres.Add(%v) result: %v\n", bp, result)
return err, uuid.New().String()
}
}

item := ""
Expand Down Expand Up @@ -544,13 +549,12 @@ func Store(bp bssTypes.BootParams) (error, string) {
debugf("Store(%v)\n", bp)

if useSQL {
debugf("postgres.Add(%v)\n", bp)
result, err := bssdb.Add(bp)
if err != nil {
debugf("postgres.Set(%v)\n", bp)
if err := bssdb.Set(bp); err != nil {
return err, ""
} else {
return err, uuid.New().String()
}
debugf("postgres.Add result: %v\n", result)
return err, uuid.New().String()
}

var kernel_id, initrd_id string
Expand Down
2 changes: 1 addition & 1 deletion cmd/boot-script-service/default_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ func BootparametersPut(w http.ResponseWriter, r *http.Request) {
}
w.WriteHeader(http.StatusOK)
} else {
LogBootParameters(fmt.Sprintf("/bootparameters PATCH FAILED: %s", err.Error()), args)
LogBootParameters(fmt.Sprintf("/bootparameters PUT FAILED: %s", err.Error()), args)
herr, ok := base.GetHMSError(err)
if ok && herr.GetProblem() != nil {
base.SendProblemDetails(w, herr.GetProblem(), 0)
Expand Down
Loading
Loading