[open-ils-commits] r53 - constrictor/trunk/contrib/evergreen
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 26 16:22:19 EST 2008
Author: erickson
Date: 2008-11-26 16:22:15 -0500 (Wed, 26 Nov 2008)
New Revision: 53
Modified:
constrictor/trunk/contrib/evergreen/eg_fetch_user_groups.py
constrictor/trunk/contrib/evergreen/eg_tasks.py
constrictor/trunk/contrib/evergreen/eg_utils.py
Log:
some updates to repair API drift with opensrf/evergreen
Modified: constrictor/trunk/contrib/evergreen/eg_fetch_user_groups.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_fetch_user_groups.py 2008-11-26 14:38:11 UTC (rev 52)
+++ constrictor/trunk/contrib/evergreen/eg_fetch_user_groups.py 2008-11-26 21:22:15 UTC (rev 53)
@@ -1,7 +1,6 @@
from constrictor.task import Task
from constrictor.script import Script, ScriptManager
from constrictor.log import *
-from osrf.gateway import XMLGatewayRequest
import eg_utils
SERVICE = 'open-ils.actor'
@@ -14,7 +13,7 @@
Task.__init__(self, self.__class__.__name__)
def run(self, **kwargs):
- request = XMLGatewayRequest(SERVICE, METHOD)
+ request = eg_utils.request(SERVICE, METHOD)
return request.send()
Modified: constrictor/trunk/contrib/evergreen/eg_tasks.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_tasks.py 2008-11-26 14:38:11 UTC (rev 52)
+++ constrictor/trunk/contrib/evergreen/eg_tasks.py 2008-11-26 21:22:15 UTC (rev 53)
@@ -1,6 +1,5 @@
from constrictor.task import Task
from constrictor.log import *
-from osrf.gateway import XMLGatewayRequest
import eg_utils
from oils.const import *
from osrf.net_obj import *
Modified: constrictor/trunk/contrib/evergreen/eg_utils.py
===================================================================
--- constrictor/trunk/contrib/evergreen/eg_utils.py 2008-11-26 14:38:11 UTC (rev 52)
+++ constrictor/trunk/contrib/evergreen/eg_utils.py 2008-11-26 21:22:15 UTC (rev 53)
@@ -4,7 +4,8 @@
import osrf.json
from osrf.gateway import GatewayRequest, XMLGatewayRequest, JSONGatewayRequest
from oils.utils.idl import IDLParser
-from oils.utils.utils import eventText, eventCode, md5sum
+from oils.utils.utils import md5sum
+from oils.event import Event
from oils.const import *
import os, errno
@@ -56,7 +57,7 @@
def fetchSessionUser():
user = request('open-ils.auth', 'open-ils.auth.session.retrieve', authtoken()).send()
- if eventCode(user):
+ if Event.parse_event(user):
raise ILSEventException(osrf.json.to_json(user))
logInfo("fetched user %s" % user.usrname())
return user
@@ -90,8 +91,8 @@
file.close()
logInfo("parsing Evergreen IDL file...")
- parser.setIDL(filePath)
- parser.parseIDL()
+ parser.set_IDL(filePath)
+ parser.parse_IDL()
class AtomicReqWrapper(object):
@@ -151,8 +152,9 @@
'type' : 'staff'
}).send()
- if eventText(result) != OILS_EVENT_SUCCESS:
- raise AuthException(eventText(result))
+ evt = Event.parse_event(result)
+ if evt and not evt.success:
+ raise AuthException(evt.textcode)
__authtoken = result['payload']['authtoken']
return __authtoken
More information about the open-ils-commits
mailing list