Changeset 8681 for main/waeup.stress/trunk/src/waeup
- Timestamp:
- 11 Jun 2012, 13:24:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.stress/trunk/src/waeup/stress/__init__.py
r8672 r8681 68 68 return 69 69 70 def start_instance(name): 70 def start_instance(name, mode='paster'): 71 """Start instance `name` in `mode`. 72 73 The `name` should be someone like 'kofa', 'uniben', etc. where 74 ``waeup.<NAME>`` is an existent instance in the `instances/` 75 directory. 76 77 `mode` can be one of `paster`|`kofactl` and tells how to start the 78 instance. 79 """ 71 80 path = kofa_projects[name] 72 print "WAEUP.STRESS: starting instance %s at %s" % (name, path) 81 print "WAEUP.STRESS: starting instance %s at %s using %s" % ( 82 name, path, mode), 73 83 old_cwd_ = os.getcwd() 74 84 os.chdir(path) 75 85 # yes, shell _is_ neccessary here 76 subprocess.call( 77 './bin/paster serve --daemon parts/etc/debug.ini', shell=True) 86 if mode == 'kofactl': 87 subprocess.call('./bin/kofactl start', shell=True) 88 else: 89 # by default we start paster as daemon 90 subprocess.call( 91 './bin/paster serve --daemon parts/etc/debug.ini', shell=True) 78 92 os.chdir(old_cwd_) 79 93 return … … 92 106 return 93 107 94 def stop_instance(name): 108 def stop_instance(name, mode='paster'): 109 """Stop instance `name` in `mode`. 110 111 The `name` should be someone like 'kofa', 'uniben', etc. where 112 ``waeup.<NAME>`` is an existent instance in the `instances/` 113 directory. 114 115 `mode` can be one of `paster`|`kofactl` and tells which tool to 116 use to stop the instance. 117 """ 95 118 path = kofa_projects[name] 96 print "WAEUP.STRESS: shutting down instance %s at %s" % (name, path), 119 print "WAEUP.STRESS: shutting down instance %s at %s using %s" % ( 120 name, path, mode), 97 121 old_cwd_ = os.getcwd() 98 122 os.chdir(path) 99 subprocess.call( 123 if mode == 'kofactl': 124 subprocess.call('./bin/kofactl stop', shell=True) 125 else: 126 # by default we use paster 127 subprocess.call( 100 128 './bin/paster serve --stop-daemon', shell=True) 101 129 print "... done."
Note: See TracChangeset for help on using the changeset viewer.