• David Johnson's avatar
    A nasty hack to get pubkeys into Openstack "portably". · 6def427b
    David Johnson authored
    This is really, really ugly.  So, keystone and nova don't offer us a way to
    upload keypairs on behalf of another user.  Recall, we're using the adminapi
    account to do all this setup, because we don't know the admin password.  So,
    the below code adds all the keys as 'adminapi', then we dump the sql, do some
    sed magic on it to get rid of the primary key and change the user_id to the
    real admin user_id, then we insert those rows, then we cleanup the lint.  By
    doing it this way, we eliminate our dependency on the SQL format and column
    names and semantics.  We make two assumptions: 1) that there is only one field
    that has integer values, and 2) the only field that is an exception to #1 is
    called 'deleted' and we just set those all to 0 after we jack the whacked sql
    in.  Ugh, it's worse than I hoped, but whatever.
    This is one of the sickest one-liners I've ever come up with, but it
    works like a charm!
setup-user-info.py 4.19 KB