Created
March 15, 2012 09:10
Revisions
-
yaronp68 created this gist
Mar 15, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ @Override public void stopManagementMachines() throws TimeoutException, CloudProvisioningException { final String token = createAuthenticationToken(); final long endTime = calcEndTimeInMillis( DEFAULT_SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); List<Node> nodes; try { nodes = listServers(token); } catch (final OpenstackException e) { throw new CloudProvisioningException(e); } final List<String> ids = new LinkedList<String>(); for (final Node node : nodes) { if (node.getName().startsWith( this.serverNamePrefix)) { try { ids.add(node.getId()); } catch (final Exception e) { throw new CloudProvisioningException(e); } } } try { terminateServers( ids, token, endTime); } catch (final TimeoutException e) { throw e; } catch (final Exception e) { throw new CloudProvisioningException("Failed to shut down managememnt machines", e); } }