From 6c5b4a81c875735aa27e3f798961870ef5cfc815 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 26 Oct 2011 09:47:17 +0200 Subject: [PATCH] provide proper error message in case ftp login fails --- kernel_inpbuilder.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel_inpbuilder.py b/kernel_inpbuilder.py index f8b6311..e28417c 100644 --- a/kernel_inpbuilder.py +++ b/kernel_inpbuilder.py @@ -431,11 +431,16 @@ if __name__ == '__main__': if not build_kernel(kernel_flavour, REVISION, OVERLAY_DIR): exit(ERROR) else: - ftp = FTP( + try: + ftp = FTP( 'alexandria.profitbricks.localdomain', 'debian-uploader', 'vae6tooZe1ec' - ) + ) + except: + logger.error('Cannot login via ftp...') + exit(ERROR) + ftp.cwd('/srv/profitbricks-repository/incoming') logger.info('FTP Login on %s successful' %(ftp.host)) -- 2.39.5