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.
This commit is contained in:
Michael Hudson-Doyle 2021-05-03 11:01:25 +12:00
parent 046949f087
commit 6a9d100b64
1 changed files with 11 additions and 3 deletions

View File

@ -14,14 +14,22 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import sys import sys
from console_conf.controllers.identity import write_login_details_standalone
from subiquitycore.log import setup_logger from subiquitycore.log import setup_logger
from subiquitycore import __version__ as VERSION
from console_conf.controllers.identity import write_login_details_standalone
def main(): def main():
setup_logger(dir='/var/log/console-conf') logger = setup_logger(dir='/var/log/console-conf')
write_login_details_standalone() 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__': if __name__ == '__main__':