Closed paulburlumi closed 4 years ago
The GetConnectionByUuid method appears not be implemented yet.
As a workaround I wrote:
func getConnection(wantedUUID string) (gonetworkmanager.Connection, error) { settings, err := gonetworkmanager.NewSettings() if err != nil { return nil, fmt.Errorf("NewSettings failed: %v", err) } connections, err := settings.ListConnections() for _, c := range connections { settings, err := c.GetSettings() if err != nil { return nil, fmt.Errorf("GetSettings failed: %v", err) } uuid, ok := settings["connection"]["uuid"].(string) if !ok { return nil, fmt.Errorf("got data of type %T, but wanted string", uuid) } if uuid == wantedUUID { return c, nil } } return nil, fmt.Errorf("connection with uuid: %s not found, exiting", wantedUUID) }
Hi Paul,
Can you please make a pull request so you I can test and merge this and credits are made accordingly?
Thanks
The GetConnectionByUuid method appears not be implemented yet.
As a workaround I wrote: