Commit a2cbb463 authored by Srikanth Raju's avatar Srikanth Raju Committed by Leigh Stoller

Make the "most recent" pubkey first served

And hope it's a protocol 2 key, I really can't think of anything else
outside of asking the user which key to serve at image creation time to
this one ssh key problem
parent 8db2b731
......@@ -142,7 +142,7 @@ class Ec2MetaHandler(BaseHTTPRequestHandler):
"join experiments on experiments.pid=group_membership.pid AND experiments.gid=group_membership.gid "
"join reserved on reserved.exptidx=experiments.idx "
"join interfaces on reserved.node_id=interfaces.node_id "
"where interfaces.ip=%s and user_pubkeys.uid=experiments.expt_swap_uid "
"where interfaces.ip=%s and user_pubkeys.uid=experiments.expt_swap_uid ORDER BY idx DESC "
"UNION "
"select user_pubkeys.uid,user_pubkeys.idx from user_pubkeys "
"join group_membership on group_membership.uid = user_pubkeys.uid "
......@@ -177,7 +177,7 @@ class Ec2MetaHandler(BaseHTTPRequestHandler):
"join experiments on experiments.pid=group_membership.pid AND experiments.gid=group_membership.gid "
"join reserved on reserved.exptidx=experiments.idx "
"join interfaces on reserved.node_id=interfaces.node_id "
"where interfaces.ip=%s and user_pubkeys.uid=experiments.expt_swap_uid) "
"where interfaces.ip=%s and user_pubkeys.uid=experiments.expt_swap_uid ORDER BY idx DESC) "
"UNION "
"(select user_pubkeys.pubkey from user_pubkeys "
"join group_membership on group_membership.uid = user_pubkeys.uid "
......
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