Esempio n. 1
0
def rebuild_by_snapshot(context, server):
    server_id = server.id
    snapshot_ensure = "snapshot-{}-ensure".format(server_id)

    snapshot_flow = snapshot_tasks.migrate_snapshot(context, server)

    return [], [], [snapshot_flow], snapshot_ensure
Esempio n. 2
0
    def test_migrate_snapshot(self, flow_mock,
                              ensure_snapshot_mock,
                              ensure_image_mock):
        flow = snapshot.migrate_snapshot(
            self.context,
            self.test_server_info,
        )

        flow_mock.assert_called_once_with("migrate-ephemeral-"
                                          "storage-server-{}"
                                          .format(self.test_server_id))
        self.assertEqual(flow.add.call_args_list,
                         [call(ensure_snapshot_mock()),
                          call(ensure_image_mock())])