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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> commit 0ef6afb2f6cdd6cdaeee3885a95099c63f18fc8c
> Author: Maxim Bublis <b@xxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxx>
---
 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


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux