From 297c8bfbcc11ce81cb39cc5a662daf6cbee8600f Mon Sep 17 00:00:00 2001 From: srivickynesh Date: Wed, 14 Mar 2018 18:06:29 +0530 Subject: Snapshot: Library to list all snapshots under .snaps directory Change-Id: I3c1f3f1c7ca11f5f4b5b80e0f208b7f0085c13df Signed-off-by: srivickynesh --- glustolibs-gluster/glustolibs/gluster/uss_ops.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/glustolibs-gluster/glustolibs/gluster/uss_ops.py b/glustolibs-gluster/glustolibs/gluster/uss_ops.py index 491481613..a6f9b8f98 100644 --- a/glustolibs-gluster/glustolibs/gluster/uss_ops.py +++ b/glustolibs-gluster/glustolibs/gluster/uss_ops.py @@ -146,3 +146,24 @@ def is_snapd_running(mnode, volname): % mnode) return False return True + + +def uss_list_snaps(client, mount): + + """List snapshots under .snaps directory + Args: + client(str):client on which commands has to be executed + mount(str): Mount points to be executed + Returns: + tuple: Tuple containing three elements (ret, out, err). + The first element 'ret' is of type 'int' and is the return value + of command execution. + + The second element 'out' is of type 'str' and is the stdout value + of the command execution. + + The third element 'err' is of type 'str' and is the stderr value + of the command execution. + """ + cmd = "ls -R %s/.snaps" % (mount) + return g.run(client, cmd) -- cgit