diff --git a/mgradm/cmd/install/podman/utils.go b/mgradm/cmd/install/podman/utils.go index f42a1649b..ec2c4bfe6 100644 --- a/mgradm/cmd/install/podman/utils.go +++ b/mgradm/cmd/install/podman/utils.go @@ -31,15 +31,15 @@ func setupHubXmlrpcContainer(flags *podmanInstallFlags) error { } hubXmlrpcImage, err := utils.ComputeImage(flags.HubXmlrpc.Image.Name, tag) if err != nil { - return fmt.Errorf(L("failed to compute image URL, %s"), err) + return utils.Errorf(err, L("failed to compute image URL")) } if err := podman.GenerateHubXmlrpcSystemdService(hubXmlrpcImage); err != nil { - return fmt.Errorf(L("cannot generate systemd service: %s"), err) + return utils.Errorf(err, L("cannot generate systemd service")) } if err := shared_podman.EnableService(shared_podman.HubXmlrpcService); err != nil { - return fmt.Errorf(L("cannot enable service: %s"), err) + return utils.Errorf(err, L("cannot enable service")) } } return nil diff --git a/mgradm/cmd/status/podman.go b/mgradm/cmd/status/podman.go index be8090c86..18efa41d6 100644 --- a/mgradm/cmd/status/podman.go +++ b/mgradm/cmd/status/podman.go @@ -41,7 +41,7 @@ func podmanStatus( if podman.HasService(podman.HubXmlrpcService) { if err := utils.RunCmdStdMapping(zerolog.DebugLevel, "systemctl", "status", podman.HubXmlrpcService); err != nil { - return fmt.Errorf(L("failed to get status of the server service: %s"), err) + return utils.Errorf(err, L("failed to get status of the server service")) } } diff --git a/mgradm/shared/podman/podman.go b/mgradm/shared/podman/podman.go index dc8139067..8806e81a5 100644 --- a/mgradm/shared/podman/podman.go +++ b/mgradm/shared/podman/podman.go @@ -75,13 +75,13 @@ func GenerateHubXmlrpcSystemdService(image string) error { Image: image, } if err := utils.WriteTemplateToFile(hubXmlrpcData, podman.GetServicePath(podman.HubXmlrpcService), 0555, false); err != nil { - return fmt.Errorf(L("failed to generate systemd service unit file: %s"), err) + return utils.Errorf(err, L("failed to generate systemd service unit file")) } environment := fmt.Sprintf(`Environment=UYUNI_IMAGE=%s `, image) if err := podman.GenerateSystemdConfFile(podman.HubXmlrpcService, "Service", environment); err != nil { - return fmt.Errorf(L("cannot generate systemd conf file: %s"), err) + return utils.Errorf(err, L("cannot generate systemd conf file")) } return podman.ReloadDaemon(false)