summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-16 02:24:43 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-16 02:28:10 +0200
commit308de544f4dd1e23197d3b6d3be85cef1f5f9ded (patch)
tree04f2cba70adbb472f494bb7551a99dac62d9734b /source4/scripting
parentf7ada51c29a517e841843c2a869ac9d16c7057d4 (diff)
downloadsamba-308de544f4dd1e23197d3b6d3be85cef1f5f9ded.tar.gz
samba-308de544f4dd1e23197d3b6d3be85cef1f5f9ded.tar.bz2
samba-308de544f4dd1e23197d3b6d3be85cef1f5f9ded.zip
python: Provide way to iterate over available shares.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/shares.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/shares.py b/source4/scripting/python/samba/shares.py
index 622c3b6486..89a312e855 100644
--- a/source4/scripting/python/samba/shares.py
+++ b/source4/scripting/python/samba/shares.py
@@ -41,8 +41,11 @@ class SharesContainer(object):
return len(self._lp)-1
return len(self._lp)
+ def keys(self):
+ return [name for name in self._lp.services() if name != "global"]
+
def __iter__(self):
- return self.lp.services()
+ return iter(self.keys())
class Share(object):