]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
provide proper error message in case ftp login fails
authorHolger Levsen <holger@layer-acht.org>
Wed, 26 Oct 2011 07:47:17 +0000 (09:47 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 26 Oct 2011 07:47:17 +0000 (09:47 +0200)
kernel_inpbuilder.py

index f8b63112e7b5cc79f12089a25d88befdc68a85b6..e28417c9d46febcfdec6358eceae0ef83539df47 100644 (file)
@@ -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))