Browse Source

automatically grab the ssh key needed for each server exported

Change-Id: Ia051089b5ac18f2e17fb7e5171ebfcc278fd6d03
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Doug Hellmann 1 year ago
parent
commit
21e4d45eb1
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      downpour/resolver.py

+ 9
- 3
downpour/resolver.py View File

@@ -183,17 +183,23 @@ class Resolver:
183 183
             yield self._map_uuids('subnet', subnet.name, subnet.id, 'subnet.id')
184 184
 
185 185
     def server(self, server, save_state):
186
+        # The ssh key needed to login to the server.
187
+        keypair = self.cloud.get_keypair(server.key_name)
188
+        yield from self.keypair(keypair)
189
+        # The security groups and other network settings for the
190
+        # server.
186 191
         for sg in server.security_groups:
187 192
             sg_data = self.cloud.get_security_group(sg.name)
188 193
             yield from self.security_group(sg_data)
194
+        for net_name in server.networks:
195
+            net_data = self.cloud.get_network(net_name)
196
+            yield from self.network(net_data)
197
+        # Any volumes attached to the server.
189 198
         vol_names = []
190 199
         for vol in server.volumes:
191 200
             vol_data = self.cloud.get_volume(vol.id)
192 201
             vol_names.append(vol_data.name)
193 202
             yield from self.volume(vol_data, save_state)
194
-        for net_name in server.networks:
195
-            net_data = self.cloud.get_network(net_name)
196
-            yield from self.network(net_data)
197 203
         # FIXME(dhellmann): Need to handle public IPs. Use auto_ip?
198 204
         # FIXME(dhellmann): For now assume the image exists, but we may
199 205
         #                   have to dump and recreate it.

Loading…
Cancel
Save