Fallback on PWD for the Validation json log instead of getcwd

fallback on getcwd is wrong because the current directory for
the ansible runtime is somewhere in the artifact dir..
We should fallback in the PWD of the current user instead, then
the user and the framework could find the log when
/var/log/validations does not exists

Change-Id: Ida25474d687fba690ab6a342ac61a484e6d939fa
This commit is contained in:
matbu 2021-04-06 23:22:44 +02:00
parent fce90fec89
commit d67b2a0097
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ VALIDATIONS_LOG_DIR = (os.getenv('VALIDATIONS_LOG_DIR')
('/var/log/validations'
if os.path.exists('/var/log/validations')
and os.access('/var/log/validations', os.W_OK) else
os.getcwd()))
os.environ.get('PWD')))
def current_time():