Skip to content

Commit

Permalink
add missing return of properties in DescribeMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
pallotron committed Oct 11, 2024
1 parent 7d375ec commit 8b07e70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion machine1/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions machine1/dbus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b07e70

Please sign in to comment.