File tree Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Expand file tree Collapse file tree 3 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 4
4
5
5
require (
6
6
github.com/hashicorp/terraform-plugin-sdk/v2 v2.3.0
7
- github.com/matishsiao/goInfo v0.0.0-20200404012835-b5f882ee2288
7
+ github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f
8
8
)
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
188
188
github.com/kylelemons/godebug v1.1.0 /go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw =
189
189
github.com/matishsiao/goInfo v0.0.0-20200404012835-b5f882ee2288 h1:cdM7et8/VlNnSBpq3KbyQWsYLCY0WsB7tvV8Fr0DUNE =
190
190
github.com/matishsiao/goInfo v0.0.0-20200404012835-b5f882ee2288 /go.mod h1:yLZrFIhv+Z20hxHvcZpEyKVQp9HMsOJkXAxx7yDqtvg =
191
+ github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f h1:B0OD7nYl2FPQEVrw8g2uyc1lGEzNbvrKh7fspGZcbvY =
192
+ github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f /go.mod h1:aEt7p9Rvh67BYApmZwNDPpgircTO2kgdmDUoF/1QmwA =
191
193
github.com/mattn/go-colorable v0.0.9 /go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU =
192
194
github.com/mattn/go-isatty v0.0.3 /go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4 =
193
195
github.com/mattn/go-isatty v0.0.4 /go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4 =
Original file line number Diff line number Diff line change @@ -35,13 +35,36 @@ func dataSourceUname() *schema.Resource {
35
35
}
36
36
37
37
func dataSourceUnameRead (d * schema.ResourceData , _ interface {}) error {
38
- //
39
38
40
- d .Set ("kernel_name" , goInfo .GetInfo ().Kernel )
41
- d .Set ("nodename" , goInfo .GetInfo ().Hostname )
42
- d .Set ("kernel_release" , goInfo .GetInfo ().Core )
43
- d .Set ("machine" , goInfo .GetInfo ().Platform )
44
- d .Set ("operating_system" , goInfo .GetInfo ().OS )
39
+ goInfo , err := goInfo .GetInfo ()
40
+ if err != nil {
41
+ return err
42
+ }
43
+
44
+ err = d .Set ("kernel_name" , goInfo .Kernel )
45
+ if err != nil {
46
+ return err
47
+ }
48
+
49
+ err = d .Set ("nodename" , goInfo .Hostname )
50
+ if err != nil {
51
+ return err
52
+ }
53
+
54
+ err = d .Set ("kernel_release" , goInfo .Core )
55
+ if err != nil {
56
+ return err
57
+ }
58
+
59
+ err = d .Set ("machine" , goInfo .Platform )
60
+ if err != nil {
61
+ return err
62
+ }
63
+
64
+ err = d .Set ("operating_system" , goInfo .OS )
65
+ if err != nil {
66
+ return err
67
+ }
45
68
46
69
return nil
47
70
You can’t perform that action at this time.
0 commit comments