pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/py-rt py-rt: Gracefully handle noop edit_ticket()



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1e0971558b0d
branches:  trunk
changeset: 397242:1e0971558b0d
user:      leot <leot%pkgsrc.org@localhost>
date:      Wed Jun 19 10:51:54 2019 +0000

description:
py-rt: Gracefully handle noop edit_ticket()

In RT 4 when edit_ticket() is invoked but the ticket is not modified an empty
response is sent.  Gracefully treat it as a successfull operation.

PKGREVISION++

diffstat:

 net/py-rt/Makefile            |   4 ++--
 net/py-rt/distinfo            |   4 ++--
 net/py-rt/patches/patch-rt.py |  17 ++++++++++++++---
 3 files changed, 18 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r 211ad045f07e -r 1e0971558b0d net/py-rt/Makefile
--- a/net/py-rt/Makefile        Wed Jun 19 10:22:50 2019 +0000
+++ b/net/py-rt/Makefile        Wed Jun 19 10:51:54 2019 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2019/06/09 13:57:27 leot Exp $
+# $NetBSD: Makefile,v 1.3 2019/06/19 10:51:54 leot Exp $
 
 DISTNAME=      rt-1.0.11
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    net python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=r/rt/}
 
diff -r 211ad045f07e -r 1e0971558b0d net/py-rt/distinfo
--- a/net/py-rt/distinfo        Wed Jun 19 10:22:50 2019 +0000
+++ b/net/py-rt/distinfo        Wed Jun 19 10:51:54 2019 +0000
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.2 2019/06/09 13:57:27 leot Exp $
+$NetBSD: distinfo,v 1.3 2019/06/19 10:51:54 leot Exp $
 
 SHA1 (py-rt/rt-1.0.11.tar.gz) = 2a919c9df7a7aec75aa9f1f19df9fbc81341e784
 RMD160 (py-rt/rt-1.0.11.tar.gz) = cd0ee2929ede3c878e21bf0750e4fe262550ded5
 SHA512 (py-rt/rt-1.0.11.tar.gz) = 00007710d152472bf25e656b6298502e0b571932c8c3f4c498074fe7a849d575fd2deaad91a4814a7aece4dbfa847c913045e927830a8e0a02d3d13876562696
 Size (py-rt/rt-1.0.11.tar.gz) = 35084 bytes
-SHA1 (patch-rt.py) = a1180f06f39e1dba6fca86205755549c34d6b8b8
+SHA1 (patch-rt.py) = 304b17e48ea144b0553f9bf18b142b9e59ceb684
diff -r 211ad045f07e -r 1e0971558b0d net/py-rt/patches/patch-rt.py
--- a/net/py-rt/patches/patch-rt.py     Wed Jun 19 10:22:50 2019 +0000
+++ b/net/py-rt/patches/patch-rt.py     Wed Jun 19 10:51:54 2019 +0000
@@ -1,7 +1,9 @@
-$NetBSD: patch-rt.py,v 1.1 2019/06/09 13:57:27 leot Exp $
+$NetBSD: patch-rt.py,v 1.2 2019/06/19 10:51:54 leot Exp $
 
-Backport upstream commit bb07009c4f62dd2ac393aab82fded6424eead82f
-to ignore ignore possible empty lines.
+- Backport upstream commit bb07009c4f62dd2ac393aab82fded6424eead82f
+  to ignore ignore possible empty lines.
+- RT 4 when a ticket is not modified return an empty response, treat it as
+  a successfull operation.
 
 --- rt.py.orig 2018-07-16 12:47:27.000000000 +0000
 +++ rt.py
@@ -27,3 +29,12 @@
                  _, ticket_id = msg.split('/', 1)
                  items.append({'id': 'ticket/' + ticket_id})
              return items
+@@ -685,6 +689,8 @@ class Rt:
+             else:
+                 post_data += "CF.{{{}}}: {}\n".format(key[3:], value)
+         msg = self.__request('ticket/{}/edit'.format(str(ticket_id)), post_data={'content': post_data})
++        if "" == msg: # Ticket not modified
++            return True
+         state = msg.split('\n')[2]
+         return self.RE_PATTERNS['update_pattern'].match(state) is not None
+ 



Home | Main Index | Thread Index | Old Index