~ubuntu-branches/ubuntu/maverick/eucalyptus/maverick

« back to all changes in this revision

Viewing changes to clc/modules/msgs/conf/scripts/startup.groovy

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey)
  • Date: 2010-07-21 17:27:10 UTC
  • mfrom: (1.1.38 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721172710-7xv07dmdqgivc3t9
Tags: 2.0~bzr1211-0ubuntu1
* New major upstream version merge, 2.0 (r1211).
* debian/patches/:
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import org.hibernate.HibernateException;
2
 
 
3
 
import com.eucalyptus.auth.CredentialProvider;
4
 
import com.eucalyptus.auth.Credentials;
5
 
import com.eucalyptus.auth.User;
6
 
import com.eucalyptus.auth.UserExistsException;
7
 
import com.eucalyptus.util.EntityWrapper;
8
 
import com.eucalyptus.util.EucalyptusCloudException;
9
 
import edu.ucsb.eucalyptus.cloud.entities.Counters;
10
 
import edu.ucsb.eucalyptus.cloud.entities.UserGroupInfo;
11
 
import edu.ucsb.eucalyptus.cloud.entities.UserInfo;
12
 
import edu.ucsb.eucalyptus.cloud.entities.VmType;
13
 
import edu.ucsb.eucalyptus.util.UserManagement;
14
 
import com.eucalyptus.bootstrap.DeferredInitializer;
15
 
 
16
 
 
17
 
EntityWrapper<User> dbu = Credentials.getEntityWrapper( );
18
 
try {
19
 
  for( User u : dbu.query( new User( ) ) ) {
20
 
    if( u.getIsEnabled() != Boolean.FALSE ) {
21
 
      u.setIsEnabled( Boolean.TRUE )
22
 
    }
23
 
  }
24
 
  dbu.commit();
25
 
} catch( Throwable e ) {
26
 
  dbu.rollback();
27
 
}
28
 
EntityWrapper<VmType> db2 = new EntityWrapper<VmType>( );
29
 
try {
30
 
  if( db2.query( new VmType() ).size( ) == 0 ) { 
31
 
    db2.add( new VmType( "m1.small", 1, 2, 192 ) );
32
 
    db2.add( new VmType( "c1.medium", 1, 5, 256 ) );
33
 
    db2.add( new VmType( "m1.large", 2, 10, 512 ) );
34
 
    db2.add( new VmType( "m1.xlarge", 2, 20, 1024 ) );
35
 
    db2.add( new VmType( "c1.xlarge", 4, 20, 2048 ) );
36
 
  }
37
 
  db2.commit( );
38
 
} catch ( Exception e ) {
39
 
  db2.rollback( );
40
 
  return false;
41
 
}
42
 
EntityWrapper<UserGroupInfo> db3 = new EntityWrapper<UserGroupInfo>( );
43
 
try {
44
 
  db3.getUnique( new UserGroupInfo( "all" ) );
45
 
  db3.rollback();
46
 
} catch ( EucalyptusCloudException e ) {
47
 
  db3.add( new UserGroupInfo( "all" ) );
48
 
  db3.commit( );
49
 
}
50
 
try {
51
 
  UserGroupInfo.named( "all" );
52
 
} catch ( EucalyptusCloudException e1 ) {
53
 
}
54
 
EntityWrapper<UserInfo> db = new EntityWrapper<UserInfo>( );
55
 
try {
56
 
  db.getUnique( new UserInfo("admin") );
57
 
  db.commit( );
58
 
  return true;
59
 
} catch ( Exception e ) {
60
 
  try {//FIXME: fix this nicely
61
 
    CredentialProvider.addUser("admin",true);
62
 
  } catch ( UserExistsException e1 ) {
63
 
    e1.printStackTrace();
64
 
  }
65
 
  try {
66
 
    db.getSession( ).persist( new Counters( ) );
67
 
    UserInfo u = UserManagement.generateAdmin( );
68
 
    db.add( u );
69
 
    db.commit( );
70
 
  } catch ( HibernateException e1 ) {
71
 
    db.rollback( );
72
 
    return false;
73
 
  }
74
 
  return true;
75
 
}
76
 
 
77