Skip to content

Commit

Permalink
Fix vra_machine resource
Browse files Browse the repository at this point in the history
* Fix lint issues
* Costmetic documentation improvements

Signed-off-by: Ferran Rodenas <ferran.rodenas@broadcom.com>
  • Loading branch information
frodenas committed Dec 13, 2024
1 parent 412d485 commit 099ecf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions vra/resource_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
},
},
},
Expand Down Expand Up @@ -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",
},
},
},
Expand Down Expand Up @@ -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)}
}
}
Expand Down Expand Up @@ -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)}
}
}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/vra_machine.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down

0 comments on commit 099ecf0

Please sign in to comment.