Commit f2cfb415 authored by Filippos Giannakos's avatar Filippos Giannakos

Make vlmc list volumes using python rados module

parent b737a7f6
......@@ -947,13 +947,15 @@ def vlmc_snapshot(args):
def vlmc_list(args):
if STORAGE == "rados":
#FIXME use
cmd = [ 'rados', '-p', '%s' % RADOS_POOL_MAPS, 'ls' ]
proc = Popen(cmd, stdout = PIPE)
while proc.poll() is None:
output = proc.stdout.readline()
if output.startswith(ARCHIP_PREFIX) and not output.endswith('_lock\n'):
print output.lstrip(ARCHIP_PREFIX),
import rados
cluster = rados.Rados(conffile='/etc/ceph/ceph.conf')
ioctx = cluster.open_ioctx(RADOS_POOL_MAPS)
oi = rados.ObjectIterator(ioctx)
for o in oi :
name = o.key
if name.startswith(ARCHIP_PREFIX) and not name.endswith('_lock'):
print name.lstrip(ARCHIP_PREFIX)
elif STORAGE == "files":
raise Error("Vlmc list not supported for files yet")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment