Skip to content

Commit

Permalink
F #414: fix missing permission update management
Browse files Browse the repository at this point in the history
  • Loading branch information
treywelsh committed Oct 6, 2023
1 parent f28911f commit df20cc0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions opennebula/resource_opennebula_marketplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,20 @@ func resourceOpennebulaMarketPlaceUpdate(ctx context.Context, d *schema.Resource

}

if d.HasChange("permissions") {
if perms, ok := d.GetOk("permissions"); ok {
err = mpc.Chmod(permissionUnix(perms.(string)))
if err != nil {
diags = append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: "Failed to change permissions",
Detail: fmt.Sprintf("marketplace (ID: %s): %s", d.Id(), err),
})
return diags
}
}
}

if d.HasChange("disabled") {
disabled := d.Get("disabled").(bool)
err := mpc.Enable(!disabled)
Expand Down

0 comments on commit df20cc0

Please sign in to comment.