Skip to content

Commit

Permalink
CellsV1: Also save keypairs to cell level DB
Browse files Browse the repository at this point in the history
This is needed when moving to cellsV2 as instance keypairs
are expected to live in the compute cell.

Closes-Bug: #1761197

Change-Id: I1ed758c52c4e40bcd749d52193dc184630f0defd
  • Loading branch information
sorrison committed May 9, 2019
1 parent fa00aa3 commit 962b7ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nova/cells/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ def _create_instances_here(self, ctxt, instance_uuids, instance_properties,
# FIXME(danms): Same for ec2_ids
instance_values.pop('ec2_ids', None)

# FIXME(danms): Same for keypairs
instance_values.pop('keypairs', None)
keypairs = instance_values.pop('keypairs', None)
if keypairs:
keypair_objs = []
for keypair in keypairs:
keypair_obj = objects.KeyPair._from_db_object(
ctxt, objects.KeyPair(), keypair)
keypair_objs.append(keypair_obj)
instance_values['keypairs'] = objects.KeyPairList(
objects=keypair_objs)

instances = []
num_instances = len(instance_uuids)
Expand Down

0 comments on commit 962b7ff

Please sign in to comment.