From 5cf3781ad4beddfab5aa7181c0990a5462ffe06f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 7 Feb 2018 18:54:13 +0200 Subject: Change: make all .service units be conditional on config If the config file is missing, the unit won't start. --- ick2/versionapi.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ick2/versionapi.py') diff --git a/ick2/versionapi.py b/ick2/versionapi.py index fddfdcc..40d1dda 100644 --- a/ick2/versionapi.py +++ b/ick2/versionapi.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 Lars Wirzenius +# Copyright (C) 2017-2018 Lars Wirzenius # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -18,6 +18,13 @@ import ick2 class VersionAPI(ick2.APIbase): + def __init__(self, state): + super().__init__(state) + self._blob_service_url = None + + def set_blob_service_url(self, url): + self._blob_service_url = url + def get_routes(self, path): # pragma: no cover return [ { @@ -28,7 +35,10 @@ class VersionAPI(ick2.APIbase): ] def get_version(self, **kwargs): - return {'version': ick2.__version__} + return { + 'version': ick2.__version__, + 'blob_service': self._blob_service_url, + } def create(self, body, **kwargs): # pragma: no cover pass -- cgit v1.2.1