Use utils.CommaJoin to add spaces after comma, clean up code a bit. Before: Tag(s) 'bar','baz','foo','moo' not found After: Tag(s) 'bar', 'baz', 'foo', 'moo' not found
Signed-off-by: Michael Hanselmann <[email protected]> --- lib/cmdlib.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 3f0abb4..4c15b58 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -9928,12 +9928,13 @@ class LUDelTags(TagsLU): objects.TaggableObject.ValidateTag(tag) del_tags = frozenset(self.op.tags) cur_tags = self.target.GetTags() - if not del_tags <= cur_tags: - diff_tags = del_tags - cur_tags - diff_names = ["'%s'" % tag for tag in diff_tags] - diff_names.sort() + + diff_tags = del_tags - cur_tags + if diff_tags: + diff_names = ("'%s'" % i for i in sorted(diff_tags)) raise errors.OpPrereqError("Tag(s) %s not found" % - (",".join(diff_names)), errors.ECODE_NOENT) + (utils.CommaJoin(diff_names), ), + errors.ECODE_NOENT) def Exec(self, feedback_fn): """Remove the tag from the object. -- 1.7.0.4
