"# Script to check instance status": null,
"instance-check": null,
+ "# Regular expression to ignore existing tags": null,
+ "ignore-tags-re": null,
+
"nodes": [
{
"# Master node": null,
import tempfile
import random
+import re
+import itertools
from ganeti import utils
from ganeti import constants
])
+def _FilterTags(seq):
+ """Removes unwanted tags from a sequence.
+
+ """
+ ignore_re = qa_config.get("ignore-tags-re", None)
+
+ if ignore_re:
+ return itertools.ifilterfalse(re.compile(ignore_re).match, seq)
+ else:
+ return seq
+
+
def TestTags(kind, name, tags):
"""Tests .../tags resources.
raise errors.ProgrammerError("Unknown tag kind")
def _VerifyTags(data):
- AssertEqual(sorted(tags), sorted(data))
+ AssertEqual(sorted(tags), sorted(_FilterTags(data)))
queryargs = "&".join("tag=%s" % i for i in tags)