Show More
@@ -60,7 +60,8 b' class DbManage(object):' | |||||
60 | self.sa = meta.Session |
|
60 | self.sa = meta.Session | |
61 |
|
61 | |||
62 | def create_tables(self, override=False): |
|
62 | def create_tables(self, override=False): | |
63 | """Create a auth database |
|
63 | """ | |
|
64 | Create a auth database | |||
64 | """ |
|
65 | """ | |
65 |
|
66 | |||
66 | log.info("Any existing database is going to be destroyed") |
|
67 | log.info("Any existing database is going to be destroyed") | |
@@ -86,7 +87,8 b' class DbManage(object):' | |||||
86 | log.info('db version set to: %s', __dbversion__) |
|
87 | log.info('db version set to: %s', __dbversion__) | |
87 |
|
88 | |||
88 | def upgrade(self): |
|
89 | def upgrade(self): | |
89 | """Upgrades given database schema to given revision following |
|
90 | """ | |
|
91 | Upgrades given database schema to given revision following | |||
90 | all needed steps, to perform the upgrade |
|
92 | all needed steps, to perform the upgrade | |
91 |
|
93 | |||
92 | """ |
|
94 | """ | |
@@ -125,7 +127,8 b' class DbManage(object):' | |||||
125 | # UPGRADE STEPS |
|
127 | # UPGRADE STEPS | |
126 | #====================================================================== |
|
128 | #====================================================================== | |
127 | class UpgradeSteps(object): |
|
129 | class UpgradeSteps(object): | |
128 | """Those steps follow schema versions so for example schema |
|
130 | """ | |
|
131 | Those steps follow schema versions so for example schema | |||
129 | for example schema with seq 002 == step_2 and so on. |
|
132 | for example schema with seq 002 == step_2 and so on. | |
130 | """ |
|
133 | """ | |
131 |
|
134 | |||
@@ -166,7 +169,8 b' class DbManage(object):' | |||||
166 | getattr(UpgradeSteps(self), 'step_%s' % step)() |
|
169 | getattr(UpgradeSteps(self), 'step_%s' % step)() | |
167 |
|
170 | |||
168 | def fix_repo_paths(self): |
|
171 | def fix_repo_paths(self): | |
169 | """Fixes a old rhodecode version path into new one without a '*' |
|
172 | """ | |
|
173 | Fixes a old rhodecode version path into new one without a '*' | |||
170 | """ |
|
174 | """ | |
171 |
|
175 | |||
172 | paths = self.sa.query(RhodeCodeUi)\ |
|
176 | paths = self.sa.query(RhodeCodeUi)\ | |
@@ -183,7 +187,8 b' class DbManage(object):' | |||||
183 | raise |
|
187 | raise | |
184 |
|
188 | |||
185 | def fix_default_user(self): |
|
189 | def fix_default_user(self): | |
186 | """Fixes a old default user with some 'nicer' default values, |
|
190 | """ | |
|
191 | Fixes a old default user with some 'nicer' default values, | |||
187 | used mostly for anonymous access |
|
192 | used mostly for anonymous access | |
188 | """ |
|
193 | """ | |
189 | def_user = self.sa.query(User)\ |
|
194 | def_user = self.sa.query(User)\ | |
@@ -202,7 +207,8 b' class DbManage(object):' | |||||
202 | raise |
|
207 | raise | |
203 |
|
208 | |||
204 | def fix_settings(self): |
|
209 | def fix_settings(self): | |
205 | """Fixes rhodecode settings adds ga_code key for google analytics |
|
210 | """ | |
|
211 | Fixes rhodecode settings adds ga_code key for google analytics | |||
206 | """ |
|
212 | """ | |
207 |
|
213 | |||
208 | hgsettings3 = RhodeCodeSetting('ga_code', '') |
|
214 | hgsettings3 = RhodeCodeSetting('ga_code', '') | |
@@ -246,10 +252,10 b' class DbManage(object):' | |||||
246 | else: |
|
252 | else: | |
247 | log.info('creating admin and regular test users') |
|
253 | log.info('creating admin and regular test users') | |
248 | from rhodecode.tests import TEST_USER_ADMIN_LOGIN,\ |
|
254 | from rhodecode.tests import TEST_USER_ADMIN_LOGIN,\ | |
249 |
TEST_USER_ADMIN_PASS |
|
255 | TEST_USER_ADMIN_PASS, TEST_USER_ADMIN_EMAIL,\ | |
250 |
TEST_USER_REGULAR_PASS, |
|
256 | TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS,\ | |
251 |
TEST_USER_REGULAR2_LOGIN, |
|
257 | TEST_USER_REGULAR_EMAIL, TEST_USER_REGULAR2_LOGIN, \ | |
252 | TEST_USER_REGULAR2_EMAIL |
|
258 | TEST_USER_REGULAR2_PASS, TEST_USER_REGULAR2_EMAIL | |
253 |
|
259 | |||
254 | self.create_user(TEST_USER_ADMIN_LOGIN, TEST_USER_ADMIN_PASS, |
|
260 | self.create_user(TEST_USER_ADMIN_LOGIN, TEST_USER_ADMIN_PASS, | |
255 | TEST_USER_ADMIN_EMAIL, True) |
|
261 | TEST_USER_ADMIN_EMAIL, True) | |
@@ -261,10 +267,11 b' class DbManage(object):' | |||||
261 | TEST_USER_REGULAR2_EMAIL, False) |
|
267 | TEST_USER_REGULAR2_EMAIL, False) | |
262 |
|
268 | |||
263 | def create_ui_settings(self): |
|
269 | def create_ui_settings(self): | |
264 | """Creates ui settings, fills out hooks |
|
270 | """ | |
|
271 | Creates ui settings, fills out hooks | |||
265 | and disables dotencode |
|
272 | and disables dotencode | |
|
273 | """ | |||
266 |
|
274 | |||
267 | """ |
|
|||
268 | #HOOKS |
|
275 | #HOOKS | |
269 | hooks1_key = RhodeCodeUi.HOOK_UPDATE |
|
276 | hooks1_key = RhodeCodeUi.HOOK_UPDATE | |
270 | hooks1_ = self.sa.query(RhodeCodeUi)\ |
|
277 | hooks1_ = self.sa.query(RhodeCodeUi)\ | |
@@ -305,7 +312,7 b' class DbManage(object):' | |||||
305 | largefiles = RhodeCodeUi() |
|
312 | largefiles = RhodeCodeUi() | |
306 | largefiles.ui_section = 'extensions' |
|
313 | largefiles.ui_section = 'extensions' | |
307 | largefiles.ui_key = 'largefiles' |
|
314 | largefiles.ui_key = 'largefiles' | |
308 |
largefiles.ui_value = ' |
|
315 | largefiles.ui_value = '' | |
309 |
|
316 | |||
310 | self.sa.add(hooks1) |
|
317 | self.sa.add(hooks1) | |
311 | self.sa.add(hooks2) |
|
318 | self.sa.add(hooks2) | |
@@ -351,7 +358,6 b' class DbManage(object):' | |||||
351 | path_ok = False |
|
358 | path_ok = False | |
352 | log.error('No write permission to given path %s', path) |
|
359 | log.error('No write permission to given path %s', path) | |
353 |
|
360 | |||
354 |
|
||||
355 | if retries == 0: |
|
361 | if retries == 0: | |
356 | sys.exit('max retries reached') |
|
362 | sys.exit('max retries reached') | |
357 | if path_ok is False: |
|
363 | if path_ok is False: |
General Comments 0
You need to be logged in to leave comments.
Login now