diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2008-09-03 16:10:00 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2008-09-03 16:10:00 +0000 |
commit | 2bdbb8e7570695f8a5070d380b78bad13ae5070f (patch) | |
tree | 80644b7691ac54ec5462284f6a2c7b91a1e1ab35 | |
parent | 0a59783d3891a85174e9308cd7d573a644149624 (diff) | |
download | bcfg2-2bdbb8e7570695f8a5070d380b78bad13ae5070f.tar.gz bcfg2-2bdbb8e7570695f8a5070d380b78bad13ae5070f.tar.bz2 bcfg2-2bdbb8e7570695f8a5070d380b78bad13ae5070f.zip |
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
-rwxr-xr-x | src/sbin/bcfg2-repo-validate | 5 |
1 files changed, 4 insertions, 1 deletions
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, |