From 6a9d100b64e1fcb34a38e9e4dc47deeb5fada4be Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 3 May 2021 11:01:25 +1200 Subject: [PATCH] have console-conf-write-login-details exit with code 2 when no IPs found Also make the log files resulting from console-conf-write-login-details execution a bit easier to spot. --- console_conf/cmd/write_login_details.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/console_conf/cmd/write_login_details.py b/console_conf/cmd/write_login_details.py index 6ff97675..1c0b7085 100755 --- a/console_conf/cmd/write_login_details.py +++ b/console_conf/cmd/write_login_details.py @@ -14,14 +14,22 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import logging import sys -from console_conf.controllers.identity import write_login_details_standalone + from subiquitycore.log import setup_logger +from subiquitycore import __version__ as VERSION + +from console_conf.controllers.identity import write_login_details_standalone def main(): - setup_logger(dir='/var/log/console-conf') - write_login_details_standalone() + logger = setup_logger(dir='/var/log/console-conf') + logger = logging.getLogger('console_conf') + logger.info( + "Starting console-conf-write-login-details v{}".format(VERSION)) + logger.info("Arguments passed: {}".format(sys.argv)) + return write_login_details_standalone() if __name__ == '__main__':