Skip to content

Commit

Permalink
changes incorporate incoming DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Lou Wolford committed Apr 2, 2012
1 parent 27a6f44 commit 05d08b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LR/lr/controllers/distribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DistributeController(BaseController):

def __before__(self):
self.resource_data = appConfig['couchdb.db.resourcedata']
self.incoming = appConfig['couchdb.db.incoming']
"""REST Controller styled on the Atom Publishing Protocol"""
# To properly map this controller, ensure your config/routing.py
# file has a resource setup:
Expand Down Expand Up @@ -176,7 +177,8 @@ def doDistribution(connectionInfo, server, sourceUrl):
#if distinationNode['distribute service'] .service_auth["service_authz"] is not None:
#log.info("Destination node '{}' require authentication".format(destinationUrl))
#Try to get the user name and password the url
destinationUrl = connectionInfo['destinationNodeInfo'].resource_data_url
#destinationUrl = connectionInfo['destinationNodeInfo'].resource_data_url
destinationUrl = connectionInfo['destinationNodeInfo'].incoming_url

credential = sourceLRNode.getDistributeCredentialFor(destinationUrl)
if credential is not None:
Expand Down Expand Up @@ -222,7 +224,8 @@ def doDistribution(connectionInfo, server, sourceUrl):
if connectionsStatusInfo.has_key(self.__ERROR) or connectionStatus.has_key(self.__ERROR) == True:
distributeResults.put(connectionStatus)
else:
replicationArgs = (connectionStatus, defaultCouchServer, self.resource_data )
replicationArgs = (connectionStatus, defaultCouchServer, self.incoming )
#replicationArgs = (connectionStatus, defaultCouchServer, self.resource_data )
# Use a thread to do the actual replication.
replicationThread = threading.Thread(target=doDistribution, args=replicationArgs)
replicationThread.start()
Expand Down
2 changes: 2 additions & 0 deletions LR/lr/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ def getNodeConfig():
# periodic distribution.
monitorResourceDataChanges()



1 change: 1 addition & 0 deletions LR/lr/model/node_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def getDistributeInfo(self):
'gateway_node':self.nodeDescription.gateway_node,
'social_community':self.communityDescription.social_community,
'resource_data_url': appConfig['lr.distribute_resource_data_url'],
'incoming_url': appConfig['lr.distribute_incoming_url'],
'filter_description':self.filterDescription.specData
}
return distributeInfo
Expand Down

0 comments on commit 05d08b1

Please sign in to comment.