Skip to content

Commit

Permalink
fix integration tests making backup policy optional in droplet action…
Browse files Browse the repository at this point in the history
…s enable backups
  • Loading branch information
loosla committed Nov 13, 2024
1 parent 3b4e2da commit b23966b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions commands/droplet_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,16 @@ func RunDropletActionEnableBackups(c *CmdConfig) error {
}

policyPath, err := c.Doit.GetString(c.NS, doctl.ArgDropletBackupPolicy)
if err != nil {
return nil, err
}
if policyPath != "" {
if err == nil && policyPath != "" {
policy, err := droplets.ReadDropletBackupPolicy(os.Stdin, policyPath)
if err != nil {
return nil, err
}

return das.EnableBackupsWithPolicy(id, policy)
} else {
return das.EnableBackups(id)
}

return das.EnableBackups(id)
}

return performAction(c, fn)
Expand Down

0 comments on commit b23966b

Please sign in to comment.