~ubuntuone-hackers/conn-check/trunk

« back to all changes in this revision

Viewing changes to conn_check/utils/convert_fw_rules.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Guillermo Gonzalez
  • Date: 2023-07-04 14:17:08 UTC
  • mfrom: (143.1.2 conn-check-focal)
  • Revision ID: otto-copilot@canonical.com-20230704141708-s8dfji74114kniy1
fix 2 calls to yaml.load, use yaml.safe_load instead

Merged from https://code.launchpad.net/~verterok/conn-check/focal/+merge/445911

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    merged_rules = {}
36
36
 
37
37
    for path in paths:
38
 
        rules = yaml.load(open(path))
 
38
        rules = yaml.safe_load(open(path))
39
39
 
40
40
        for rule in rules.get('egress', []):
41
41
            from_ip = IPNetwork(gethostbyname(rule['from_host']))