Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions SoftLayer/CLI/hardware/ready.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Check if a virtual server is ready."""
"""Check if a server is ready."""
# :license: MIT, see LICENSE for more details.

import click
Expand All @@ -11,15 +11,17 @@

@click.command()
@click.argument('identifier')
@click.option('--wait', default=0, show_default=True, type=click.INT, help="Seconds to wait")
@click.option('--wait', default=0, show_default=True, type=click.INT,
help="Seconds to wait")
@environment.pass_env
def cli(env, identifier, wait):
"""Check if a virtual server is ready."""
"""Check if a server is ready."""

compute = SoftLayer.HardwareManager(env.client)
compute_id = helpers.resolve_id(compute.resolve_ids, identifier, 'hardware')
compute_id = helpers.resolve_id(compute.resolve_ids, identifier,
'hardware')
ready = compute.wait_for_ready(compute_id, wait)
if ready:
env.fout("READY")
else:
raise exceptions.CLIAbort("Instance %s not ready" % compute_id)
raise exceptions.CLIAbort("Server %s not ready" % compute_id)