From b23966bb9f42959eb697de7ec3922c10c586c91e Mon Sep 17 00:00:00 2001 From: Anna Lushnikova Date: Wed, 13 Nov 2024 09:07:34 -0500 Subject: [PATCH] fix integration tests making backup policy optional in droplet actions enable backups --- commands/droplet_actions.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/commands/droplet_actions.go b/commands/droplet_actions.go index 3193fd0b1..8c3c11572 100644 --- a/commands/droplet_actions.go +++ b/commands/droplet_actions.go @@ -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)