From 14dcabf21d308b69d0ec0a3ed910953f22e3aed8 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 9 Apr 2015 14:24:43 +0530 Subject: snapshot/scheduler: Fix deleting of snapshot schedule Check if the argument has an attribute before validating the attribute. Change-Id: Ia4c6c91c2fca2ec3e82b47d81fbc19a5e0f17eb4 BUG: 1210204 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/10168 Reviewed-by: Aravinda VK Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- extras/snap_scheduler/snap_scheduler.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/extras/snap_scheduler/snap_scheduler.py b/extras/snap_scheduler/snap_scheduler.py index a20216d2492..fb3f446a4f1 100755 --- a/extras/snap_scheduler/snap_scheduler.py +++ b/extras/snap_scheduler/snap_scheduler.py @@ -372,16 +372,17 @@ def initialise_scheduler(): def syntax_checker(args): ret = False - if (len(args.jobname.split()) != 1): - output("Invalid Jobname. Jobname should not be empty and should not contain \" \" character.") - return ret - - if (len(args.volname.split()) != 1): - output("Invalid Volname. Volname should not be empty and should not contain \" \" character.") - return ret + if hasattr(args, 'jobname'): + if (len(args.jobname.split()) != 1): + output("Invalid Jobname. Jobname should not be empty and should not contain \" \" character.") + return ret + args.jobname=args.jobname.strip() - args.jobname=args.jobname.strip() - args.volname=args.volname.strip() + if hasattr(args, 'volname'): + if (len(args.volname.split()) != 1): + output("Invalid Volname. Volname should not be empty and should not contain \" \" character.") + return ret + args.volname=args.volname.strip() ret = True return ret -- cgit