Commit ef004441 authored by Jonathon Duerig's avatar Jonathon Duerig

Changes for OSDI Demo. Alphabetized node list. Other minor fixes.

parent 1ebb5ea6
......@@ -170,20 +170,58 @@ package
{
var rspec : XML = XML(str);
var nodeName : QName = new QName(rspec.namespace(), "node");
var xmlNodes : Array = new Array();
for each (var element in rspec.elements(nodeName))
{
if (element.attribute("uuid") != null
&& element.attribute("uuid") != "")
{
names[index].push(element.attribute("name"));
uuids[index].push(element.attribute("uuid"));
xmlNodes.push(element);
}
}
xmlNodes.sort(xmlSort);
var i : int = 0;
for (; i < xmlNodes.length; ++i)
{
names[index].push(xmlNodes[i].attribute("name"));
uuids[index].push(xmlNodes[i].attribute("uuid"));
}
}
states[index] = NORMAL;
updateList();
}
function xmlSort(left : XML, right : XML) : int
{
// TODO: Make this an actual natural sort
var leftAttribute = left.attribute("name");
var rightAttribute = right.attribute("name");
if (leftAttribute.substr(0, 2) == "pc"
&& rightAttribute.substr(0, 2) == "pc"
&& int(leftAttribute.substr(2)) > 0
&& int(rightAttribute.substr(2)) > 0)
{
var leftNum = int(leftAttribute.substr(2));
var rightNum = int(rightAttribute.substr(2));
if (leftNum < rightNum)
{
return -1;
}
else if (leftNum > rightNum)
{
return 1;
}
else
{
return 0;
}
}
else
{
return leftAttribute.localeCompare(rightAttribute);
}
}
public function failResources(index : int)
{
states[index] = FAILED;
......
......@@ -21,6 +21,7 @@ package
base = null;
slice = null;
slivers = null;
ssh = null;
}
public function setupSlivers(count : int)
......@@ -36,5 +37,6 @@ package
public var base : String;
public var slice : String;
public var slivers : Array;
public var ssh : Object;
}
}
......@@ -20,6 +20,7 @@ package
static var cm : String = "cm";
public static var getCredential = new Array(ch, "GetCredential");
public static var getKeys = new Array(ch, "GetKeys");
public static var resolve = new Array(ch, "Resolve");
public static var remove = new Array(ch, "Remove");
public static var register = new Array(ch, "Register");
......
......@@ -118,6 +118,30 @@ package
if (code == 0)
{
credential.base = String(response.value);
startSshLookup();
}
else
{
codeFailure();
}
}
function startSshLookup() : void
{
opName = "Acquiring SSH Keys";
clip.loadText.text = opName;
op.reset(Geni.getKeys);
op.addField("credential", credential.base);
op.call(completeSshLookup, failure);
addSend();
}
function completeSshLookup(code : Number, response : Object) : void
{
addResponse();
if (code == 0)
{
credential.ssh = response.value;
startUserLookup();
}
else
......@@ -126,6 +150,7 @@ package
}
}
function startUserLookup() : void
{
opName = "Lookup User";
......
......@@ -49,6 +49,7 @@ package
op.reset(Geni.redeemTicket);
op.addField("ticket", cm.getTicket(cmIndex));
op.addField("impotent", Request.IMPOTENT);
// op.addField("keys", credential.ssh);
op.setUrl(cm.getUrl(cmIndex));
}
return op;
......
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