jenkins job fails with yaml has no attribute full loader

30 Views Asked by At

i have upgraded the Pyyaml version to 5.3.1. Python 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import yaml yaml.version '5.3.1'

When i run it locally on the server it works fine but when a docker based job does the same thing it fails with following error:

20:45:05 ############ Run docker container ############ 20:45:05 Network seastone-02_default Creating 20:45:06 Network seastone-02_default Created 20:45:06 Container seastone-02-seastone_seastone-e02-1 Creating 20:45:06 Container seastone-02-seastone_seastone-e02-1 Created 20:45:06 Attaching to seastone-02-seastone_seastone-e02-1 20:45:06 seastone-02-seastone_seastone-e02-1 | Traceback (most recent call last): 20:45:06 seastone-02-seastone_seastone-e02-1 | File "CRobot.py", line 258, in 20:45:06 seastone-02-seastone_seastone-e02-1 | main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7], sys.argv[8]) 20:45:06 seastone-02-seastone_seastone-e02-1 | File "CRobot.py", line 87, in main 20:45:06 seastone-02-seastone_seastone-e02-1 | testTag = getTagFromConfigFile() 20:45:06 seastone-02-seastone_seastone-e02-1 | File "CRobot.py", line 76, in getTagFromConfigFile 20:45:06 seastone-02-seastone_seastone-e02-1 | caseInfo = YamlParse.getTestCaseInfo() 20:45:06 seastone-02-seastone_seastone-e02-1 | File "/crobot/crobot/YamlParse.py", line 57, in getTestCaseInfo 20:45:06 seastone-02-seastone_seastone-e02-1 | return parse('../config/TestCases.yaml') 20:45:06 seastone-02-seastone_seastone-e02-1 | File "/crobot/crobot/YamlParse.py", line 22, in parse 20:45:06 seastone-02-seastone_seastone-e02-1 | dict = yaml.load(str, Loader=yaml.FullLoader) 20:45:06 seastone-02-seastone_seastone-e02-1 | AttributeError: module 'yaml' has no attribute 'FullLoader' 20:45:06 seastone-02-seastone_seastone-e02-1 exited with code 1

Do we have to update something on the jenkins?

cmdline used: ./start_crobot.sh -s seastone_diag -p seastone_seastone-e02 -t CONFIG_FILE 1 -e NO_EXIT (ignore its an internal gig to run certain scripts)

i tried upgrading the pyyaml version but it didnt help

0

There are 0 best solutions below