From 099ecf085681717046dedddf3716d23184fb2433 Mon Sep 17 00:00:00 2001 From: Ferran Rodenas Date: Fri, 13 Dec 2024 10:10:06 -0800 Subject: [PATCH] Fix vra_machine resource * Fix lint issues * Costmetic documentation improvements Signed-off-by: Ferran Rodenas --- vra/resource_machine.go | 18 +++++++++--------- website/docs/r/vra_machine.html.markdown | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vra/resource_machine.go b/vra/resource_machine.go index 0b6cc4b..62f5db3 100644 --- a/vra/resource_machine.go +++ b/vra/resource_machine.go @@ -78,7 +78,7 @@ func resourceMachine() *schema.Resource { "attach_disks_before_boot": { Type: schema.TypeBool, Optional: true, - Description: "By default, disks are attached after the VM has been built as FCDs cannot be attached to machine as day 0", + Description: "By default, disks are attached after the machine has been built. FCDs cannot be attached to machine as a day 0 task.", }, "disks": { Type: schema.TypeSet, @@ -104,12 +104,12 @@ func resourceMachine() *schema.Resource { "scsi_controller": { Type: schema.TypeString, Optional: true, - Description: "The id of the scsi controller. Example: SCSI_Controller_0", + Description: "The id of the SCSI controller. Example: SCSI_Controller_0", }, "unit_number": { Type: schema.TypeString, Optional: true, - Description: "The unit number of the scsi controller. Example: 2", + Description: "The unit number of the SCSI controller. Example: 2", }, }, }, @@ -138,12 +138,12 @@ func resourceMachine() *schema.Resource { "scsi_controller": { Type: schema.TypeString, Optional: true, - Description: "The id of the scsi controller. Example: SCSI_Controller_0", + Description: "The id of the SCSI controller. Example: SCSI_Controller_0", }, "unit_number": { Type: schema.TypeString, Optional: true, - Description: "The unit number of the scsi controller. Example: 2", + Description: "The unit number of the SCSI controller. Example: 2", }, }, }, @@ -520,8 +520,8 @@ func attachAndDetachDisks(ctx context.Context, d *schema.ResourceData, apiClient Name: diskToAttach["name"].(string), } - if v_scsi_controller, ok_scsi_controller := diskToAttach["scsi_controller"].(string); ok_scsi_controller && v_scsi_controller != "" { - if v_unit_number, ok_unit_number := diskToAttach["unit_number"].(string); ok_unit_number && v_unit_number != "" { + if vScsiController, okScsiController := diskToAttach["scsi_controller"].(string); okScsiController && vScsiController != "" { + if vUnitNumber, okUnitNumber := diskToAttach["unit_number"].(string); okUnitNumber && vUnitNumber != "" { diskAttachmentSpecification.DiskAttachmentProperties = map[string]string{"scsiController": diskToAttach["scsi_controller"].(string), "unitNumber": diskToAttach["unit_number"].(string)} } } @@ -659,8 +659,8 @@ func expandDisks(configDisks []interface{}) []*models.DiskAttachmentSpecificatio BlockDeviceID: withString(diskMap["block_device_id"].(string)), } - if v_scsi_controller, ok_scsi_controller := diskMap["scsi_controller"].(string); ok_scsi_controller && v_scsi_controller != "" { - if v_unit_number, ok_unit_number := diskMap["unit_number"].(string); ok_unit_number && v_unit_number != "" { + if vScsiController, okScsiController := diskMap["scsi_controller"].(string); okScsiController && vScsiController != "" { + if vUnitNumber, okUnitNumber := diskMap["unit_number"].(string); okUnitNumber && vUnitNumber != "" { disk.DiskAttachmentProperties = map[string]string{"scsiController": diskMap["scsi_controller"].(string), "unitNumber": diskMap["unit_number"].(string)} } } diff --git a/website/docs/r/vra_machine.html.markdown b/website/docs/r/vra_machine.html.markdown index 78b9d27..99da22b 100644 --- a/website/docs/r/vra_machine.html.markdown +++ b/website/docs/r/vra_machine.html.markdown @@ -130,7 +130,7 @@ Example: `[{"mandatory" : "true", "expression": "environment":"prod"}, {"mandato * `created_at` - Date when the entity was created. Date and time format is ISO 8601 and UTC. -* `attach_disks_before_boot` - By default, disks are attached after the VM has been built as FCDs cannot be attached to machine as day 0 +* `attach_disks_before_boot` - By default, disks are attached after the machine has been built. FCDs cannot be attached to machine as a day 0 task. * `disks_list` - List of all disks attached to a machine including boot disk, and additional block devices attached using the disks attribute. @@ -140,9 +140,9 @@ Example: `[{"mandatory" : "true", "expression": "environment":"prod"}, {"mandato * `name` - Human-friendly block-device name used as an identifier in APIs that support this option. - * `scsi_controller` - The id of the scsi controller. Example: SCSI_Controller_0 + * `scsi_controller` - The id of the SCSI controller (_e.g_., `SCSI_Controller_0`.) - * `unit_number` - The unit number of the scsi controller. Example: 2 + * `unit_number` - The unit number of the SCSI controller (_e.g_., `2`.) * `external_id` - External entity ID on the provider side.