Commit 3a20b9bf authored by Yingjie Xu's avatar Yingjie Xu

Make a getFullComputerInformation method clone of getComputerInformation method.

It is required for promise based slapgrid software release.
parent 006adc33
......@@ -101,6 +101,24 @@ def getComputerInformation():
raise UnauthorizedError, "Only accept request for: %s" % \
app.config['computer_id']
@app.route('/getFullComputerInformation', methods=['GET'])
def getFullComputerInformation():
computer_id = request.args['computer_id']
if app.config['computer_id'] == computer_id:
slap_computer = Computer(computer_id)
slap_computer._software_release_list = []
for sr in execute_db('software', 'select * from %s'):
slap_computer._software_release_list.append(SoftwareRelease(
software_release=sr['url'], computer_guid=computer_id))
slap_computer._computer_partition_list = []
for partition in execute_db('partition', 'SELECT * FROM %s'):
slap_computer._computer_partition_list.append(partitiondict2partition(
partition))
return xml_marshaller.xml_marshaller.dumps(slap_computer)
else:
raise UnauthorizedError, "Only accept request for: %s" % \
app.config['computer_id']
@app.route('/setComputerPartitionConnectionXml', methods=['POST'])
def setComputerPartitionConnectionXml():
computer_id = request.form['computer_id']
......
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