Navigation Menu

Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Write db properties file in nimbus-configure
Browse files Browse the repository at this point in the history
  • Loading branch information
labisso committed Jun 1, 2010
1 parent cd56255 commit 0340d47
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions home/sbin/nimbusconfigure.py
Expand Up @@ -381,6 +381,35 @@ def write_env_file(self):
if f:
f.close()

def write_db_props(self):
"""Writes ant properties file used by db-mgmt.xml
"""
persistdir = os.path.join(self.gtdir, 'var/nimbus')
dbsetupdir = os.path.join(self.gtdir, 'share/nimbus')
dbsetuplibdir = os.path.join(self.gtdir, 'share/nimbus/lib')
derbyhomedir = os.path.join(self.gtdir, 'var')
derbylibdir = os.path.join(self.gtdir, 'lib')
pwgenfile = os.path.join(self.gtdir, 'etc/nimbus/workspace-service/other/shared-secret-suggestion.py')

lines = ['#Autogenerated by nimbus-configure\n',
'#'+time.strftime('%c')+'\n']
lines.append('workspace.dbdir.prop=%s\n' % persistdir)
lines.append('workspace.sqldir.prop=%s\n' % dbsetuplibdir)
lines.append('workspace.notifdir.prop=%s\n' % dbsetuplibdir)
lines.append('derby.system.home.prop=%s\n' % derbyhomedir)
lines.append('derby.relative.dir.prop=nimbus\n')
lines.append('derby.classpath.dir.prop=%s\n' % derbylibdir)
lines.append('pwGen.path.prop=%s\n' % pwgenfile)

db_props_path = os.path.join(dbsetupdir,'workspace.persistence.conf')
f = None
try:
f = open(db_props_path, 'w')
f.writelines(lines)
finally:
if f:
f.close()

def perform_setup(self):
# first, set up CA and host cert/key
ca_name = self["ca.name"]
Expand Down Expand Up @@ -457,6 +486,9 @@ def perform_setup(self):
# write an enviroment file
self.write_env_file()

# and db properties file
self.write_db_props()

def import_db(setup, old_db_path):
derbyrun_path = os.path.join(setup.gtdir, 'lib/derbyrun.jar')
if not os.path.exists(derbyrun_path):
Expand Down

0 comments on commit 0340d47

Please sign in to comment.