Allow push on unknown Jira issues
authorFrederic Massart <fred@moodle.com>
Tue, 20 Jan 2015 08:35:46 +0000 (16:35 +0800)
committerFrederic Massart <fred@moodle.com>
Tue, 20 Jan 2015 10:03:00 +0000 (18:03 +0800)
mdk/commands/push.py

index 161bce8..fb94dbf 100644 (file)
@@ -149,9 +149,13 @@ class PushCommand(Command):
         # If the mode is not set to patch yet, and we can identify the MDL number.
         if not args.patch and parsedbranch:
             mdlIssue = 'MDL-%s' % (parsedbranch['issue'])
-            args.patch = J.isSecurityIssue(mdlIssue)
-            if args.patch:
-                logging.info('%s appears to be a security issue, switching to patch mode...' % (mdlIssue))
+            try:
+                args.patch = J.isSecurityIssue(mdlIssue)
+                if args.patch:
+                    logging.info('%s appears to be a security issue, switching to patch mode...', mdlIssue)
+            except jira.JiraIssueNotFoundException:
+                # The issue was not found, do not perform
+                logging.warn('Could not check if %s is a security issue', mdlIssue)
 
         if args.patch:
             if not M.pushPatch(branch):