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 11, 2023
1 parent 9f35d34 commit 78870c3
Show file tree
Hide file tree
Showing 3 changed files with 16 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 @@ -1019,6 +1019,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
1 change: 1 addition & 0 deletions website/docs/r/marketplace.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following arguments are supported:

* `name` - (Required) The name of the marketplace.
* `description` - (Optional) The description of the marketplace.
* `permissions` - (Optional) Permissions applied to the appliance. Defaults to the UMASK in OpenNebula (in UNIX Format: owner-group-other => Use-Manage-Admin).
* `one` - (Optional) See [One](#One) section for details.
* `http` - (Optional) See [Http](#Http) section for details.
* `s3` - (Optional) See [S3](#S3) section for details.
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/marketplaceapp.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The following arguments are supported:
* `type` - (Required) Type of the new host: IMAGE, VMTEMPLATE, SERVICE_TEMPLATE.
* `origin_id` - (Optional) The ID of the source image. Default to `-1`.
* `description` - (Optional) Text description of the appliance.
* `permissions` - (Optional) Permissions applied to the appliance. Defaults to the UMASK in OpenNebula (in UNIX Format: owner-group-other => Use-Manage-Admin).
* `publisher` - (Optional) Publisher of the appliance.
* `version` - (Optional) A string indicating the appliance version.
* `vmtemplate64` - (Optional) Creates this template pointing to the base image.
Expand Down

0 comments on commit 78870c3

Please sign in to comment.