Commit cd6a7aec authored by Xavier Thompson's avatar Xavier Thompson

slapproxy: Propagate state to forwarded requests

parent 8fd14906
......@@ -645,6 +645,16 @@ def forwardRequestToExternalMaster(master_url, request_form):
execute_db('forwarded_partition_request', 'INSERT OR REPLACE INTO %s values(:partition_reference, :master_url)',
{'partition_reference':partition_reference, 'master_url': master_url})
# Propagate state from root instance
# XXX State propagation is already done in requestNotSlave, but not in requestSlave. Why not ?
# XXX Doing this in slapproxy/master should be considered a hack:
# XXX The instance should propagate state on its own.
requested_state = loads(request_form['state'].encode('utf-8'))
if requester_id != 'user':
root_partition = getRootPartition(requester_id)
if root_partition:
requested_state = root_partition['requested_state']
if master_entry.get('computer') and master_entry.get('partition'):
app.logger.debug("requesting from partition %s", master_entry)
# XXX ComputerPartition.request and OpenOrder.request have different signatures
......@@ -658,7 +668,7 @@ def forwardRequestToExternalMaster(master_url, request_form):
shared=loads(request_form['shared_xml'].encode('utf-8')),
partition_parameter_kw=partition_parameter_kw,
filter_kw=filter_kw,
state=loads(request_form['state'].encode('utf-8')),
state=requested_state,
)
else:
filter_kw['source_instance_id'] = partition_reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment