Browse Source

Fix pyyaml load call error

yaml.load(input) is deprecated in pyyaml 5.1. This causes the
manifests_lookup function to append the python warning message
to the look up results. The pegleg cmd fails to launch container
due to extra strings after the image url. Added code to specify
the loader if the pyyaml version is 5.1 or newer.

Change-Id: I4765df28eedf99a8e823e192cf2f2f2b38434f2c
Signed-off-by: James Gu <james.gu@att.com>
changes/33/707733/4
James Gu 1 year ago
parent
commit
40a01b2c4c
  1. 6
      tools/airship

6
tools/airship

@ -70,7 +70,11 @@ manifests_lookup(){
RESULT=`python3 -c "
import yaml,sys
y = yaml.load_all(open('$file'))
from distutils.version import StrictVersion
if StrictVersion(yaml.__version__) < StrictVersion('5.1'):
y = yaml.load_all(open('$file'))
else:
y = yaml.load_all(open('$file'), Loader=yaml.FullLoader)
for x in y:
if x.get('schema') == '$schema':
if x['metadata']['name'] == '$mdata_name':

Loading…
Cancel
Save