gvalkov / jenkins-autojobs

Automatically create Jenkins jobs from template jobs and branches in a SCM repository
http://jenkins-autojobs.rtfd.org
Other
49 stars 39 forks source link

Fix warning with Python 3.4 #62

Open LouisVN opened 7 years ago

LouisVN commented 7 years ago

Warning showing up while running with Python 3.4

/usr/local/lib/python3.4/site-packages/jenkins_autojobs/main.py:124: UnsafeLoaderWarning: The default 'Loader' for 'load(stream)' without further arguments can be unsafe. Use 'load(stream, Loader=ruamel.yaml.Loader)' explicitly if that is OK. Alternatively include the following in your code:

import warnings warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)' config = yaml.load(opts.yamlconfig)