Skip to content

Commit

Permalink
add const
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Sep 26, 2024
1 parent 4881376 commit f1fb9ba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions saltrequester.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
)

const (
dbusPath = "/org/cacophony/salt_helper"
dbusDest = "org.cacophony.salt_helper"
methodBase = "org.cacophony.salt_helper"
dbusPath = "/org/cacophony/salt_helper"
dbusDest = "org.cacophony.salt_helper"
methodBase = "org.cacophony.salt_helper"
saltVersionUrl = "https://raw.githubusercontent.com/TheCacophonyProject/salt-version-info/refs/heads/main/salt-version-info.json"
)

var log = logging.NewLogger("info")
Expand Down Expand Up @@ -206,14 +207,14 @@ func UpdateExistsForNodeGroup(nodeGroup string) (bool, time.Time, error) {
}
saltState, _ := ReadStateFile()
log.Printf("Checking for updates for saltops %v branch, last update was %v", branch, saltState.LastUpdate)
resp, err := http.Get("https://raw.githubusercontent.com/TheCacophonyProject/salt-version-info/refs/heads/main/salt-version-info.json")
resp, err := http.Get(saltVersionUrl)

if err != nil {
return false, updateTime, err
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return false, updateTime, fmt.Errorf("bad update status check %v from url %v", resp.StatusCode, "https://raw.githubusercontent.com/TheCacophonyProject/salt-version-info/refs/heads/main/salt-version-info.json")
return false, updateTime, fmt.Errorf("bad update status check %v from url %v", resp.StatusCode, saltVersionUrl)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit f1fb9ba

Please sign in to comment.