diff options
author | srivickynesh <sselvan@redhat.com> | 2018-03-14 18:06:29 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-03-27 12:21:09 +0000 |
commit | 297c8bfbcc11ce81cb39cc5a662daf6cbee8600f (patch) | |
tree | 795505cb5e1150943507f64ccdf1fdae71ea9c85 | |
parent | fb5145be2db1a7c96b008af8a40e3b7b18df9673 (diff) |
Snapshot: Library to list all snapshots under .snaps directory
Change-Id: I3c1f3f1c7ca11f5f4b5b80e0f208b7f0085c13df
Signed-off-by: srivickynesh <sselvan@redhat.com>
-rw-r--r-- | glustolibs-gluster/glustolibs/gluster/uss_ops.py | 21 |
1 files changed, 21 insertions, 0 deletions
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) |