Skip to content

Commit

Permalink
Starting to add in checks for status
Browse files Browse the repository at this point in the history
  • Loading branch information
lizsalmon committed Dec 18, 2024
1 parent d93b5bd commit b7e867d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/workflows/migrate_server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Optional

import openstackquery
from openstack.connection import Connection
from openstack_api.openstack_server import migrate_server, snapshot_server

Expand All @@ -22,5 +23,14 @@ def server_migration(
:type live: bool
"""
snapshot_server(conn, server_id)

migrate_server(conn, server_id=server_id, dest_host=destination_host, live=live)
# Determine the status of the server
query = getattr(openstackquery, "ServerQuery")()
query.select("server_status")
query.where(
preset="any_in",
prop="server_id",
values=server_id,
)
query.run("dev") # Do I need to add cloud account so that this will work on dev
print(query.to_string())
# migrate_server(conn, server_id=server_id, dest_host=destination_host, live=live)

0 comments on commit b7e867d

Please sign in to comment.