From 5862746e826a8d87efa51f7129cbf34f4e0d53cc Mon Sep 17 00:00:00 2001 From: Johnny Hughes Date: Apr 25 2019 19:24:48 +0000 Subject: modify 000_centos_default_repos.py to show enviroment vars for repos --- diff --git a/tests/0_common/000_centos_default_repos.py b/tests/0_common/000_centos_default_repos.py index a2c2fe5..0364dd5 100755 --- a/tests/0_common/000_centos_default_repos.py +++ b/tests/0_common/000_centos_default_repos.py @@ -14,14 +14,16 @@ import os yb = yum.YumBase() def getEnvironOpt(varname,defval): + global now val=defval try: val = int(os.environ[varname]) except KeyError: pass - print val + print "[+] %s -> %s:%d" % (now(),varname,val) return val +now = lambda: datetime.datetime.today().strftime("%c") centos_default_repos = ['base'] if getEnvironOpt('UPDATES',1): @@ -37,7 +39,6 @@ if getEnvironOpt('FASTTRACK',0): if getEnvironOpt('CENTOSPLUS',0): centos_default_repos.append('centosplus') -now = lambda: datetime.datetime.today().strftime("%c") print "[+] %s -> Check if non default repo is enabled" % now() for repo in yb.repos.listEnabled(): if not repo.id in centos_default_repos: