[libvirt] [PATCH console-proxy 2/6] Adapt to uuid API change

Philipp Hahn hahn at univention.de
Fri Nov 15 13:05:13 UTC 2019


> commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c
> Author: Maxim Bublis <b at codemonkey.ru>
> Date:   Wed Jan 3 16:02:28 2018 +0000
>
>     Return enthropy errors from UUID generation.
>
>     This commit changes signature for `NewV1`, `NewV2` and `NewV4` functions
>     which from now will return `(UUID, error)` instead of `UUID`.
>     To emulate old behavior of panicking on enthropy errors one can wrap
>     a call into `Must` helper similar to:
>     ```
>     u := uuid.Must(uuid.NewV4())

Signed-off-by: Philipp Hahn <hahn at univention.de>
---
 cmd/virtconsoleresolveradm/cmd/enable.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/virtconsoleresolveradm/cmd/enable.go b/cmd/virtconsoleresolveradm/cmd/enable.go
index dd95e9e..1a4a12d 100644
--- a/cmd/virtconsoleresolveradm/cmd/enable.go
+++ b/cmd/virtconsoleresolveradm/cmd/enable.go
@@ -49,8 +49,8 @@ var (
 )
 
 func createConsole(ctype string, index int, conn *libvirt.Connect, domname, domuuid string) resolver.ConsoleServerProxyMetadataConsole {
-	tokenID := uuid.NewV4()
-	tokenValue := uuid.NewV4()
+	tokenID := uuid.Must(uuid.NewV4())
+	tokenValue := uuid.Must(uuid.NewV4())
 	console := resolver.ConsoleServerProxyMetadataConsole{
 		Token:    tokenID.String(),
 		Type:     ctype,
-- 
2.20.1





More information about the libvir-list mailing list