From 2bdbb8e7570695f8a5070d380b78bad13ae5070f Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Wed, 3 Sep 2008 16:10:00 +0000 Subject: Add discard() method for use with lists git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4900 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-repo-validate | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sbin/bcfg2-repo-validate') diff --git a/src/sbin/bcfg2-repo-validate b/src/sbin/bcfg2-repo-validate index 459032346..1896d7c37 100755 --- a/src/sbin/bcfg2-repo-validate +++ b/src/sbin/bcfg2-repo-validate @@ -12,11 +12,14 @@ import Bcfg2.Options try: pdlist = set -except: +except NameError: class pdlist(list): def add(self, item): if item not in self: self.append(item) + def discard(self, item): + if item in self: + self.remove(item) if __name__ == '__main__': opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY, -- cgit v1.2.3-1-g7c22