From: Mathias Klette Date: Tue, 30 Apr 2013 15:05:15 +0000 (+0200) Subject: fix: use setdefault method instead of try/except X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=476a283d08160737a7367cf879eeb8d694f92c8c;p=profitbricks%2Fjenkins-build-scripts.git fix: use setdefault method instead of try/except --- diff --git a/common_code.py b/common_code.py index 19a89b2..76e1154 100755 --- a/common_code.py +++ b/common_code.py @@ -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'