[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] use yaml.safe_load() instead of yaml.load()
Mattia Rizzolo
gitlab at salsa.debian.org
Mon Aug 12 12:58:25 BST 2019
Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net
Commits:
fa720775 by Mattia Rizzolo at 2019-08-12T11:58:09Z
use yaml.safe_load() instead of yaml.load()
our yaml is trusted so we don't have any security risk, but this saves a
warning message on run, and it's better anyway since we don't have any
use of the full yaml loader.
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
- - - - -
3 changed files:
- nodes/gen_known_host_file
- nodes/gen_ssh_config
- nodes/list_nodes
Changes:
=====================================
nodes/gen_known_host_file
=====================================
@@ -5,7 +5,7 @@ import sys
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
- data = yaml.load(f)
+ data = yaml.safe_load(f)
class Host:
=====================================
nodes/gen_ssh_config
=====================================
@@ -4,7 +4,7 @@ import os
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
- data = yaml.load(f)
+ data = yaml.safe_load(f)
for host in data:
print('Host', host['hostname'])
=====================================
nodes/list_nodes
=====================================
@@ -4,6 +4,6 @@ import os
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
- d = yaml.load(f)
+ d = yaml.safe_load(f)
for host in d:
print(host['hostname'])
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/fa720775ae898fe384103014f06c0fadf280e482
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/fa720775ae898fe384103014f06c0fadf280e482
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190812/f5601ed6/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list