From 3efbd8cdd1f137a6e71a417edfccdd825c4605ab Mon Sep 17 00:00:00 2001 From: Yang Bo Date: Mon, 28 Jan 2019 09:27:21 +0800 Subject: [PATCH] kata-env: kata-env error out when there is no VERSION_ID. For example, under debian buster/sid. Those information should be provide with best effort instead of error out. Set name and version to "<>" if they are not defined. Fixes: #1177 Signed-off-by: Yang Bo --- cli/utils.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/utils.go b/cli/utils.go index 7252d20e3c..5a7865d58e 100644 --- a/cli/utils.go +++ b/cli/utils.go @@ -71,9 +71,15 @@ func getDistroDetails() (name, version string, err error) { } } - if name != "" && version != "" { - return name, version, nil + if name == "" { + name = unknown } + + if version == "" { + version = unknown + } + + return name, version, nil } return "", "", fmt.Errorf("failed to find expected fields in one of %v", files)