Skip to content

Commit

Permalink
goslmailer: config file path settable via GOSLMAILER_CONF env var (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pja237 authored May 23, 2022
1 parent 168e0ba commit 4f2806a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.1.4
v2.1.5
9 changes: 7 additions & 2 deletions cmd/goslmailer/goslmailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/CLIP-HPC/goslmailer/internal/version"
)

const goslmailer_config_file = "/etc/slurm/goslmailer.conf"

func main() {

var (
Expand All @@ -23,9 +25,12 @@ func main() {
)

// read configuration
// how to handle hardcoding config file?
cf, pres := os.LookupEnv("GOSLMAILER_CONF")
if !pres || cf == "" {
cf = goslmailer_config_file
}
cfg := config.NewConfigContainer()
err := cfg.GetConfig("/etc/slurm/goslmailer.conf")
err := cfg.GetConfig(cf)
if err != nil {
fmt.Printf("getConfig failed: %s", err)
os.Exit(1)
Expand Down

0 comments on commit 4f2806a

Please sign in to comment.