From: Marco Fontani Date: Sat, 20 Nov 2010 19:31:13 +0000 (+0000) Subject: Wait until server ready X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e1b1d2687c8f9842426f10c835c0afdf2c5b62e;p=p5sagit%2FOyster.git Wait until server ready --- diff --git a/lib/Oyster/Provision/Rackspace.pm b/lib/Oyster/Provision/Rackspace.pm index 6929a9a..8d0ca3f 100644 --- a/lib/Oyster/Provision/Rackspace.pm +++ b/lib/Oyster/Provision/Rackspace.pm @@ -60,6 +60,17 @@ sub create { ); $server->create_server; + do { + $|=1; + my @tmpservers = $self->_rs->get_server_detail(); + $server = ( grep { $_->name eq $self->name } @tmpservers )[0]; + print "\rServer status: ", ($server->status || '?'), " progress: ", ($server->progress || '?'); + if ( ( $server->status // '' ) ne 'ACTIVE' ) { + print " sleeping.."; + sleep 2; + } + } while ( ( $server->status // '' ) ne 'ACTIVE' ); + warn "Server public IP is: ", ($server->public_address)[0], "\n"; warn "Server root password: ", $server->adminpass, "\n";