summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-04-09 14:24:43 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-04-10 05:01:39 +0000
commit14dcabf21d308b69d0ec0a3ed910953f22e3aed8 (patch)
tree24c6cc4293aeb1798f9f90e1a13e855ca7aa5a73 /extras
parent3f21a347932d741de24bccffb761689c5b368e7e (diff)
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 <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10168 Reviewed-by: Aravinda VK <avishwan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'extras')
-rwxr-xr-xextras/snap_scheduler/snap_scheduler.py19
1 files 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