From 8b07e7015c6829510ca5e6f5b910ccbef2b2487d Mon Sep 17 00:00:00 2001 From: "Angelo Failla (pallotron)" Date: Fri, 11 Oct 2024 06:21:34 -0700 Subject: [PATCH 1/2] add missing return of properties in DescribeMachine --- machine1/dbus.go | 2 +- machine1/dbus_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/machine1/dbus.go b/machine1/dbus.go index 79c30ea0..49207eaa 100644 --- a/machine1/dbus.go +++ b/machine1/dbus.go @@ -163,7 +163,7 @@ func (c *Conn) DescribeMachine(name string) (machineProps map[string]interface{} for key, val := range dbusProps { machineProps[key] = val.Value() } - return + return machineProps, nil } // KillMachine sends a signal to a machine diff --git a/machine1/dbus_test.go b/machine1/dbus_test.go index cbf37d1d..bb515d11 100644 --- a/machine1/dbus_test.go +++ b/machine1/dbus_test.go @@ -125,6 +125,14 @@ func TestMachine(t *testing.T) { } for _, v := range machineNames { + props, err := conn.DescribeMachine(v) + if err != nil { + t.Fatal("failed to get machine properties") + } + t.Logf("machine %s properties: %v", v, props) + if len(props) == 0 { + t.Fatalf("no machine properties found for %s", v) + } tErr := conn.TerminateMachine(v) if tErr != nil { t.Fatal(tErr) From 568c7ef8d41b4cb83309de972ec30396da040a23 Mon Sep 17 00:00:00 2001 From: "Angelo Failla (pallotron)" Date: Fri, 18 Oct 2024 09:25:16 -0700 Subject: [PATCH 2/2] remove return as it still works --- machine1/dbus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine1/dbus.go b/machine1/dbus.go index 49207eaa..79c30ea0 100644 --- a/machine1/dbus.go +++ b/machine1/dbus.go @@ -163,7 +163,7 @@ func (c *Conn) DescribeMachine(name string) (machineProps map[string]interface{} for key, val := range dbusProps { machineProps[key] = val.Value() } - return machineProps, nil + return } // KillMachine sends a signal to a machine