SF.net SVN: fclient: [355] trunk/sandbox/fcp2/client.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-03-10 13:03:41
|
Revision: 355
http://fclient.svn.sourceforge.net/fclient/?rev=355&view=rev
Author: jUrner
Date: 2008-03-10 06:03:44 -0700 (Mon, 10 Mar 2008)
Log Message:
-----------
some fixes for mesages
Modified Paths:
--------------
trunk/sandbox/fcp2/client.py
Modified: trunk/sandbox/fcp2/client.py
===================================================================
--- trunk/sandbox/fcp2/client.py 2008-03-10 13:03:35 UTC (rev 354)
+++ trunk/sandbox/fcp2/client.py 2008-03-10 13:03:44 UTC (rev 355)
@@ -379,7 +379,7 @@
@return: (str) identifer of therequest
@note: the identifier returned is unique to the client but may not be unique to the node
"""
- identifier = self.newUuid(uuids=self._requests) if identifier is None else identifier
+ identifier = self._newUuid(uuids=self._requests) if identifier is None else identifier
# equip requests with some additional params
@@ -865,27 +865,19 @@
# unknown request... try to restore it
if initialRequest is None:
- #FIXME: PutComplexDir???
- if msg == message.PersistentGet:
+ #NOTE: there is no distinction between ClientPutDiskDir and ClientPutComplexDir
+ # so a bit of additional work here
+ requestType = msg['RequestType']
+ if requestType & consts.RequestType.MaskGet:
initialRequest = message.ClientGet()
- elif msg == message.PersistentPut:
+ elif requestType == consts.RequestType.PutMultiple:
+ initialRequest = message.ClientPutComplexDir()
+ elif requestType == consts.RequestType.PutDir:
+ initialRequest = message.ClientPutdiskDir()
+ else:
initialRequest = message.ClientPut()
- elif msg == message.PersistentPutDir:
- initialRequest = message.ClientPutDiskDir()
-
- initialRequest.params.update(msg.params)
- result = initialRequest.restorePersistentParams()
- if not result or CancelPersistentRequests:
- if not result:
- self._loggers['Runtime'].critical(consts.LogMessages.InvalidPersistentParams)
- self.sendMessage(
- message.RemovePersistentRequest(
- Identifier=requestIdentifier,
- Global=msg['Global'],
- )
- )
- return True
+ initialRequest.params.update(msg.params)
self._requests[initialRequest['Identifier']] = initialRequest
#FIX: remove Started param from PersistentGet / Put
@@ -1581,6 +1573,7 @@
data = ''
for n, item in enumerate(items):
+ n += 10
requestType = item.get('RequestType', None)
if requestType is None:
raise ValueError('No request type specified for item: %s' % n)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|