diff options
author | nnDarshan <dnarayan@redhat.com> | 2015-05-12 17:57:46 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-06-04 00:00:40 -0700 |
commit | b15ee49c94c07ffd3c27384b45840eafd59997d4 (patch) | |
tree | 1ee28a96e9e47472c6431a62797300b92654580b /extras | |
parent | 1a0d76fa14ee88ce17e017c3ceb311417870e944 (diff) |
snapshot/scheduler: Modified main() function to take arguments.
Modified the main function to take script arguments, so that this
script can be used as a module by other programs .
Change-Id: I902f0bc7ddfbf0d335cc087f51b1a7af4b7157fc
BUG: 1220670
Signed-off-by: n Darshan <dnarayan@redhat.com>
Reviewed-on: http://review.gluster.org/10760
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/snap_scheduler/snap_scheduler.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/extras/snap_scheduler/snap_scheduler.py b/extras/snap_scheduler/snap_scheduler.py index 1c5f9380dd8..ae5a84dacfa 100755 --- a/extras/snap_scheduler/snap_scheduler.py +++ b/extras/snap_scheduler/snap_scheduler.py @@ -581,7 +581,7 @@ def perform_operation(args): return ret -def main(): +def main(argv): initLogger() ret = -1 parser = argparse.ArgumentParser() @@ -617,7 +617,7 @@ def main(): parser_edit.add_argument("schedule", help="Schedule") parser_edit.add_argument("volname", help="Volume Name") - args = parser.parse_args() + args = parser.parse_args(argv) if not os.path.exists(SHARED_STORAGE_DIR): output("Failed: "+SHARED_STORAGE_DIR+" does not exist.") @@ -675,4 +675,4 @@ def main(): if __name__ == "__main__": - sys.exit(main()) + sys.exit(main(sys.argv[1:])) |