Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy REST API #3302

Merged
merged 16 commits into from
Sep 15, 2021
Prev Previous commit
Next Next commit
fix path load
  • Loading branch information
joshblakeley authored and vaske committed Sep 13, 2021
commit b196f57a1167b734d2e2d03d765f21dc6ed94a9a
4 changes: 2 additions & 2 deletions gateway/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ func handleAddOrUpdatePolicy(polID string, r *http.Request) (interface{}, int) {
}

// Create a filename
polFilePath := filepath.Join(config.Global().Policies.PolicyRecordName, newPol.ID+".json")
polFilePath := filepath.Join(config.Global().Policies.PolicyPath, newPol.ID+".json")

// If it exists, delete it
if _, err := os.Stat(polFilePath); err == nil {
Expand Down Expand Up @@ -854,7 +854,7 @@ func handleAddOrUpdatePolicy(polID string, r *http.Request) (interface{}, int) {

func handleDeletePolicy(polID string) (interface{}, int) {
// Generate a filename
defFilePath := filepath.Join(config.Global().Policies.PolicyRecordName, polID+".json")
defFilePath := filepath.Join(config.Global().Policies.PolicyPath, polID+".json")

// If it exists, delete it
if _, err := os.Stat(defFilePath); err != nil {
joshblakeley marked this conversation as resolved.
Show resolved Hide resolved
Expand Down