From 6ec5a916f3edb20427f758eabe3fd1ac4784f5fd Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 29 May 2018 08:32:36 +0200 Subject: [PATCH] [fix] would have failed on status.get returning None --- src/yunohost/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 65a6f6f2d..ae37bd8c7 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -263,7 +263,7 @@ def service_status(names=[]): 'active': str(status.get("ActiveState", "unknown")), 'active_at': { "timestamp": str(status.get("ActiveEnterTimestamp", "unknown")), - "human": datetime.fromtimestamp(status.get("ActiveEnterTimestamp") / 1000000).strftime("%F %X"), + "human": datetime.fromtimestamp(status["ActiveEnterTimestamp"] / 1000000).strftime("%F %X") if "ActiveEnterTimestamp" in status else "unknown", }, 'description': description, 'service_file_path': str(status.get("FragmentPath", "unknown")),