Don't allow Agent send out StartupCommand if it can not get its local IP address,

otherwise mgmt server will get an incomplete StartupCommand
This commit is contained in:
frank 2011-11-10 17:34:44 -08:00
parent 7adedca8a3
commit caf945bca2
1 changed files with 1 additions and 2 deletions

View File

@ -329,8 +329,7 @@ public class Agent implements HandlerFactory, IAgentControl {
addr = InetAddress.getLocalHost();
} catch (final UnknownHostException e) {
s_logger.warn("unknow host? ", e);
// ignore
return;
throw new CloudRuntimeException("Cannot get local IP address");
}
final Script command = new Script("hostname", 500, s_logger);