##// END OF EJS Templates
paster: further deprecated certain commands from paster....
marcink -
r2368:45c22740 default
parent child Browse files
Show More
@@ -29,7 +29,7 b' class Command(BasePasterCommand):'
29 Starts the celery worker that uses a paste.deploy configuration
29 Starts the celery worker that uses a paste.deploy configuration
30 file.
30 file.
31 """
31 """
32 usage = 'CONFIG_FILE [celeryd options...]'
32 usage = 'CONFIG_FILE'
33 summary = __doc__.splitlines()[0]
33 summary = __doc__.splitlines()[0]
34 description = "".join(__doc__.splitlines()[2:])
34 description = "".join(__doc__.splitlines()[2:])
35
35
@@ -40,4 +40,5 b' class Command(BasePasterCommand):'
40
40
41 def command(self):
41 def command(self):
42 cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file
42 cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file
43 raise Exception('This Command is deprecated please run: %s' % cmd) No newline at end of file
43 raise Exception('This Command is deprecated please run: %s' % cmd)
44
@@ -18,128 +18,26 b''
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
22 import sys
23 from paste.script.appinstall import AbstractInstallCommand
24 from paste.script.command import BadCommand
25 from paste.deploy import appconfig
26
21
27 # fix rhodecode import
22 from rhodecode.lib.paster_commands import BasePasterCommand
28 from os.path import dirname as dn
29 rc_path = dn(dn(dn(os.path.realpath(__file__))))
30 sys.path.append(rc_path)
31
23
32
24
33 class Command(AbstractInstallCommand):
25 class Command(BasePasterCommand):
34
35 default_verbosity = 1
36 max_args = 1
37 min_args = 1
38 summary = "Setup an application, given a config file"
39 usage = "CONFIG_FILE"
40 group_name = "RhodeCode"
41
42 description = """\
43
44 Setup RhodeCode according to its configuration file. This is
45 the second part of a two-phase web application installation
46 process (the first phase is prepare-app). The setup process
47 consist of things like setting up databases, creating super user
48 """
26 """
27 Start the celery worker
49
28
50 parser = AbstractInstallCommand.standard_parser(
29 Starts the celery worker that uses a paste.deploy configuration
51 simulate=True, quiet=True, interactive=True)
30 file.
52 parser.add_option(
31 """
53 '--user',
32 usage = 'CONFIG_FILE [celeryd options...]'
54 action='store',
33 summary = __doc__.splitlines()[0]
55 dest='username',
34 description = "".join(__doc__.splitlines()[2:])
56 default=None,
35
57 help='Admin Username')
36 parser = BasePasterCommand.standard_parser(quiet=True)
58 parser.add_option(
37
59 '--email',
38 def update_parser(self):
60 action='store',
39 pass
61 dest='email',
62 default=None,
63 help='Admin Email')
64 parser.add_option(
65 '--password',
66 action='store',
67 dest='password',
68 default=None,
69 help='Admin password min 6 chars')
70 parser.add_option(
71 '--api-key',
72 action='store',
73 dest='api_key',
74 help='Initial API key for the admin user')
75 parser.add_option(
76 '--repos',
77 action='store',
78 dest='repos_location',
79 default=None,
80 help='Absolute path to repositories location')
81 parser.add_option(
82 '--name',
83 action='store',
84 dest='section_name',
85 default=None,
86 help='The name of the section to set up (default: app:main)')
87 parser.add_option(
88 '--force-yes',
89 action='store_true',
90 dest='force_ask',
91 default=None,
92 help='Force yes to every question')
93 parser.add_option(
94 '--force-no',
95 action='store_false',
96 dest='force_ask',
97 default=None,
98 help='Force no to every question')
99 parser.add_option(
100 '--public-access',
101 action='store_true',
102 dest='public_access',
103 default=None,
104 help='Enable public access on this installation (default)')
105 parser.add_option(
106 '--no-public-access',
107 action='store_false',
108 dest='public_access',
109 default=None,
110 help='Disable public access on this installation ')
111
40
112 def command(self):
41 def command(self):
113 config_spec = self.args[0]
42 cmd = 'rc-setup-app %s' % self.path_to_ini_file
114 section = self.options.section_name
43 raise Exception('This Command is deprecated please run: %s' % cmd)
115 if section is None:
116 if '#' in config_spec:
117 config_spec, section = config_spec.split('#', 1)
118 else:
119 section = 'main'
120 if ':' not in section:
121 plain_section = section
122 section = 'app:' + section
123 else:
124 plain_section = section.split(':', 1)[0]
125 if not config_spec.startswith('config:'):
126 config_spec = 'config:' + config_spec
127 if plain_section != 'main':
128 config_spec += '#' + plain_section
129 config_file = config_spec[len('config:'):].split('#', 1)[0]
130 config_file = os.path.join(os.getcwd(), config_file)
131 self.logging_file_config(config_file)
132 conf = appconfig(config_spec, relative_to=os.getcwd())
133 ep_name = conf.context.entry_point_name
134 ep_group = conf.context.protocol
135 dist = conf.context.distribution
136 if dist is None:
137 raise BadCommand(
138 "The section %r is not the application (probably a filter). "
139 "You should add #section_name, where section_name is the "
140 "section that configures your application" % plain_section)
141 installer = self.get_installer(dist, ep_group, ep_name)
142 installer.setup_config(
143 self, config_file, section, self.sysconfig_install_vars(installer))
144 self.call_sysconfig_functions(
145 'post_setup_hook', installer, config_file)
@@ -59,4 +59,5 b' class UpgradeDb(BasePasterCommand):'
59 action='store_false',
59 action='store_false',
60 dest='force_ask',
60 dest='force_ask',
61 default=None,
61 default=None,
62 help='Force no to every question') No newline at end of file
62 help='Force no to every question')
63
@@ -155,11 +155,10 b' setup('
155 'main=rhodecode.config.middleware:make_pyramid_app',
155 'main=rhodecode.config.middleware:make_pyramid_app',
156 ],
156 ],
157 'paste.global_paster_command': [
157 'paste.global_paster_command': [
158 'setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command',
159 'ishell=rhodecode.lib.paster_commands.ishell:Command',
158 'ishell=rhodecode.lib.paster_commands.ishell:Command',
160 'upgrade-db=rhodecode.lib.paster_commands.upgrade_db:UpgradeDb',
159 'upgrade-db=rhodecode.lib.paster_commands.upgrade_db:UpgradeDb',
161
160
162 'make-config=rhodecode.lib.paster_commands.make_config:Command',
161 'setup-rhodecode=rhodecode.lib.paster_commands.deprecated.setup_rhodecode:Command',
163 'celeryd=rhodecode.lib.paster_commands.deprecated.celeryd:Command',
162 'celeryd=rhodecode.lib.paster_commands.deprecated.celeryd:Command',
164 ],
163 ],
165 'pyramid.pshell_runner': [
164 'pyramid.pshell_runner': [
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now