]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fix: use setdefault method instead of try/except
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 30 Apr 2013 15:05:15 +0000 (17:05 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 30 Apr 2013 15:05:15 +0000 (17:05 +0200)
common_code.py

index 19a89b267cc3b45b5800ddc6ebca04bddb1744fb..76e1154a625449de8c11b4542399635d64b25712 100755 (executable)
@@ -40,11 +40,8 @@ def exit_error():
     sys.exit(1)
 
 ENV = os.environ
-ENV.update({'ARGV': ' '.join(sys.argv)})
-try:
-    ENV.update({'NO_UPLOAD': ENV['NO_UPLOAD']})
-except KeyError as e:
-    ENV.update({'NO_UPLOAD': False})
+ENV.setdefault('ARGV',' '.join(sys.argv)
+ENV.setdefault('NO_UPLOAD','')
 
 BIN_GIT = '/usr/bin/git'
 BIN_RM = '/bin/rm'