Skip to content

Commit ec9e66a

Browse files
authored
fix(baremetal): fix os example and test (#1253)
1 parent 58ebc22 commit ec9e66a

4 files changed

+131
-73
lines changed

docs/data-sources/baremetal_os.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ description: |-
99
Gets information about a baremetal operating system.
1010
For more information, see [the documentation](https://developers.scaleway.com/en/products/baremetal/api).
1111

12+
You can also use the [scaleway-cli](https://github.com/scaleway/scaleway-cli) with `scw baremetal os list` to list all available operating systems.
13+
1214
## Example Usage
1315

1416
```hcl
1517
# Get info by os name and version
1618
data "scaleway_baremetal_os" "by_name" {
1719
name = "Ubuntu"
18-
version = "20.04"
20+
version = "20.04 LTS (Focal Fossa)"
1921
}
2022
2123
# Get info by os id

scaleway/data_source_baremetal_os.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ func dataSourceScalewayBaremetalOsRead(ctx context.Context, d *schema.ResourceDa
7979

8080
zoneID := datasourceNewZonedID(osID, zone)
8181
d.SetId(zoneID)
82-
err = d.Set("os_id", zoneID)
83-
if err != nil {
84-
return diag.FromErr(err)
85-
}
8682

83+
_ = d.Set("os_id", zoneID)
8784
_ = d.Set("zone", zone)
8885
_ = d.Set("name", osName)
8986
_ = d.Set("version", osVersion)

scaleway/data_source_baremetal_os_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestAccScalewayDataSourceBaremetalOS_Basic(t *testing.T) {
2222
Config: `
2323
data "scaleway_baremetal_os" "by_name" {
2424
name = "Ubuntu"
25-
version = "20.04"
25+
version = "20.04 LTS (Focal Fossa)"
2626
}
2727
2828
data "scaleway_baremetal_os" "by_id" {

0 commit comments

Comments
 (0)