[Commits] (pavlov) fixing bug when trying to get an item for the first time

commits at osafoundation.org commits at osafoundation.org
Thu Aug 19 13:53:45 PDT 2004


Commit by: pavlov
Modified files:
chandler/parcels/osaf/framework/webdav/Sync.py 1.5 1.6

Log message:
fixing bug when trying to get an item for the first time


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Sync.py.diff?r1=text&tr1=1.5&r2=text&tr2=1.6

Index: chandler/parcels/osaf/framework/webdav/Sync.py
diff -u chandler/parcels/osaf/framework/webdav/Sync.py:1.5 chandler/parcels/osaf/framework/webdav/Sync.py:1.6
--- chandler/parcels/osaf/framework/webdav/Sync.py:1.5	Thu Aug 19 13:32:55 2004
+++ chandler/parcels/osaf/framework/webdav/Sync.py	Thu Aug 19 13:53:44 2004
@@ -247,7 +247,10 @@
 
     # get the exported item's UUID and see if we have already fetched it
     origUUID = davItem.itsUUID
-    newItem = repository.findUUID(sharing.itemMap[origUUID])
+    try:
+        newItem = repository.findUUID(sharing.itemMap[origUUID])
+    except:
+        newItem = None
 
     if not newItem:
         # create a new item for the davItem
@@ -256,6 +259,8 @@
         newItem.sharedURL = dav.url
         # set the version to avoid sync thinking there are local changes
         newItem.sharedVersion = newItem._version
+        # set a bogus etag so it doesn't try to put
+        newItem.etag = "12345"
 
         # toss this in to the itemMap so we can find it later
         sharing.itemMap[origUUID] = newItem.itsUUID



More information about the Commits mailing list