~davewalker/ubuntu/lucid/eucalyptus/lp566792_fix_metadata_service

« back to all changes in this revision

Viewing changes to clc/modules/cluster-manager/src/main/java/com/eucalyptus/address/DynamicSystemAddressManager.java

  • Committer: Dave Walker (Daviey)
  • Date: 2010-06-22 13:16:37 UTC
  • Revision ID: davewalker@ubuntu.com-20100622131637-e7a4o4lievttet5e
debian/patches/lp566792-metadata-service.patch: Prevent invalid vm state 
change and side-effects.  Patch courtesy of upstream. (LP: #566792)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    List<Address> addressList = Lists.newArrayList( );
24
24
    if ( Addresses.getInstance( ).listDisabledValues( ).size( ) < count ) throw new NotEnoughResourcesAvailable( "Not enough resources available: addresses (try --addressing private)" );
25
25
    for ( Address addr : Addresses.getInstance( ).listDisabledValues( ) ) {
26
 
      if ( cluster.equals( addr.getCluster( ) ) ) {
27
 
        addressList.add( addr.allocate( Component.eucalyptus.name( ) ) );
28
 
        addr.pendingAssignment( );
29
 
        if ( --count == 0 ) {
30
 
          break;
 
26
      if ( cluster.equals( addr.getCluster( ) ) && !addr.isAllocated( ) ) {
 
27
        try {
 
28
          addressList.add( addr.allocate( Component.eucalyptus.name( ) ) );
 
29
          addr.pendingAssignment( );
 
30
          if ( --count == 0 ) {
 
31
            break;
 
32
          }
 
33
        } catch ( Exception e ) {
 
34
          LOG.debug( e, e );
31
35
        }
32
36
      }
33
37
    }