Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DRz8nJi3A4yqvWUN+aC4DA4KvfT4uQfaUISF7Mz98rY=; b=v3yed988LJoqNJZnBWSW6zjo27slhx79iylXadsFfqH8P/Z6CuQDqm8dTVcvueEBV2 U9l1dPyyq2ZIuhXlDzVqC85fQYH2ro+l/p6E5qy0nLad9vJO65BcXV92YpLiOHjcfp6u gpuEfCoymP85qWEXjRiQShg4X3WYGun3ZsmVrqRoi7CTU0hgxfbsvMElotP1SwZi9wFU udmSqfs73B1ul1G5MgjgwpZHdfK+uprxVWOF+ytCBB5jblKZqveLAObQOQHj9v1hPwIE jI9rdTmjTDVe3Ho9c/OLFHR2cyieja0hOOciCMrum45lXzTaGDKH3QAdSaEoM8yYnp3f 6YfA== From: Guilherme Campos Camargo Date: Tue, 24 Apr 2018 14:24:43 -0300 Message-Id: <20180424172451.2682-7-guicc@profusion.mobi> In-Reply-To: <20180424172451.2682-1-guicc@profusion.mobi> References: <20180424172451.2682-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 06/14] Prevent exception NameError when removing container List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org A NameError exception was being raised on early script exits, for example when the usage was being printed by argparse. The exception was due to the FuegoContainer object (container) not having been declared when atexit cleanup routine is called. Signed-off-by: Guilherme Campos Camargo --- engine/tests/Functional.fuego_release_test/test_run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/tests/Functional.fuego_release_test/test_run.py b/engine/tests/Functional.fuego_release_test/test_run.py index 8b97bde..ba840b6 100755 --- a/engine/tests/Functional.fuego_release_test/test_run.py +++ b/engine/tests/Functional.fuego_release_test/test_run.py @@ -603,8 +603,10 @@ def main(): @atexit.register def cleanup(): - if container: + try: container.delete() + except NameError: + pass def get_abs_working_dirs(): abs_install_dir = os.path.abspath(args.install_dir) -- 2.17.0