|
|
cb8e9e |
From beb674f81646116365ee7126266027d10e2ba8da Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: nnDarshan <dnarayan@redhat.com>
|
|
|
cb8e9e |
Date: Tue, 12 May 2015 17:57:46 +0530
|
|
|
cb8e9e |
Subject: [PATCH 68/73] snapshot/scheduler: Modified main() function to take arguments.
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Modified the main function to take script arguments, so that this
|
|
|
cb8e9e |
script can be used as a module by other programs .
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I902f0bc7ddfbf0d335cc087f51b1a7af4b7157fc
|
|
|
cb8e9e |
BUG: 1231078
|
|
|
cb8e9e |
Signed-off-by: n Darshan <dnarayan@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: http://review.gluster.org/10760
|
|
|
cb8e9e |
Reviewed-on: http://review.gluster.org/10997
|
|
|
cb8e9e |
Tested-by: Gluster Build System <jenkins@build.gluster.com>
|
|
|
cb8e9e |
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
cb8e9e |
Reviewed-by: Aravinda VK <avishwan@redhat.com>
|
|
|
cb8e9e |
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50614
|
|
|
cb8e9e |
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
|
|
|
cb8e9e |
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
extras/snap_scheduler/snap_scheduler.py | 6 +++---
|
|
|
cb8e9e |
1 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/extras/snap_scheduler/snap_scheduler.py b/extras/snap_scheduler/snap_scheduler.py
|
|
|
cb8e9e |
index b692980..09015c5 100755
|
|
|
cb8e9e |
--- a/extras/snap_scheduler/snap_scheduler.py
|
|
|
cb8e9e |
+++ b/extras/snap_scheduler/snap_scheduler.py
|
|
|
cb8e9e |
@@ -581,7 +581,7 @@ def perform_operation(args):
|
|
|
cb8e9e |
return ret
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
-def main():
|
|
|
cb8e9e |
+def main(argv):
|
|
|
cb8e9e |
initLogger()
|
|
|
cb8e9e |
ret = -1
|
|
|
cb8e9e |
parser = argparse.ArgumentParser()
|
|
|
cb8e9e |
@@ -617,7 +617,7 @@ def main():
|
|
|
cb8e9e |
parser_edit.add_argument("schedule", help="Schedule")
|
|
|
cb8e9e |
parser_edit.add_argument("volname", help="Volume Name")
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- args = parser.parse_args()
|
|
|
cb8e9e |
+ args = parser.parse_args(argv)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if not os.path.exists(SHARED_STORAGE_DIR):
|
|
|
cb8e9e |
output("Failed: "+SHARED_STORAGE_DIR+" does not exist.")
|
|
|
cb8e9e |
@@ -675,4 +675,4 @@ def main():
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if __name__ == "__main__":
|
|
|
cb8e9e |
- sys.exit(main())
|
|
|
cb8e9e |
+ sys.exit(main(sys.argv[1:]))
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|