yaml-validate: sets isn't python3

Run builtin "set" instead of python2 Sets module.

Change-Id: I2f3db189b23e5578f2f02a3a7189a7aa8323acb6
This commit is contained in:
Emilien Macchi 2018-05-08 23:24:30 -07:00
parent f9c2ae1f82
commit af7a4ab5b8

View File

@ -19,7 +19,6 @@ import traceback
import yaml
from copy import copy
from sets import Set
# Only permit the template alias versions
# The current template version should be the last element
@ -735,7 +734,7 @@ def _rsearch_keys(d, pattern, search_keynames=False, enter_lists=False):
if re.search(pattern, target):
present = False
for entry in result:
if Set(path).issubset(Set(entry)):
if set(path).issubset(set(entry)):
present = True
break
if not present:
@ -753,7 +752,7 @@ def _rsearch_keys(d, pattern, search_keynames=False, enter_lists=False):
if re.search(pattern, str(d[ind])):
present = False
for entry in result:
if Set(path).issubset(Set(entry)):
if set(path).issubset(set(entry)):
present = True
break
if not present: