##// END OF EJS Templates
fix(settings): fixed a case for certain settings that could be quoted inside .ini files
super-admin -
r1215:685ad2d3 default
parent child Browse files
Show More
@@ -78,10 +78,10 b' debugtoolbar.exclude_prefixes ='
78 78 ; default locale used by VCS systems
79 79 #locale = en_US.UTF-8
80 80
81 ; path to binaries for vcsserver, it should be set by the installer
81 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
82 82 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
83 ; it can also be a path to nix-build output in case of development
84 core.binary_dir = ""
83 ; or /usr/local/bin/rhodecode_bin/vcs_bin
84 core.binary_dir =
85 85
86 86 ; Custom exception store path, defaults to TMPDIR
87 87 ; This is used to store exception from RhodeCode in shared directory
@@ -41,10 +41,10 b' use = egg:rhodecode-vcsserver'
41 41 ; default locale used by VCS systems
42 42 #locale = en_US.UTF-8
43 43
44 ; path to binaries for vcsserver, it should be set by the installer
44 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
45 45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
46 ; it can also be a path to nix-build output in case of development
47 core.binary_dir = ""
46 ; or /usr/local/bin/rhodecode_bin/vcs_bin
47 core.binary_dir =
48 48
49 49 ; Custom exception store path, defaults to TMPDIR
50 50 ; This is used to store exception from RhodeCode in shared directory
@@ -28,6 +28,7 b' from vcsserver.type_utils import str2boo'
28 28
29 29 log = logging.getLogger(__name__)
30 30
31
31 32 # skip keys, that are set here, so we don't double process those
32 33 set_keys = {
33 34 '__file__': ''
@@ -51,6 +52,10 b' class SettingsMaker:'
51 52 return int(input_val)
52 53
53 54 @classmethod
55 def _float_func(cls, input_val):
56 return float(input_val)
57
58 @classmethod
54 59 def _list_func(cls, input_val, sep=','):
55 60 return aslist(input_val, sep=sep)
56 61
@@ -61,8 +66,17 b' class SettingsMaker:'
61 66 return input_val
62 67
63 68 @classmethod
64 def _float_func(cls, input_val):
65 return float(input_val)
69 def _string_no_quote_func(cls, input_val, lower=True):
70 """
71 Special case string function that detects if value is set to empty quote string
72 e.g.
73
74 core.binar_dir = ""
75 """
76
77 input_val = cls._string_func(input_val, lower=lower)
78 if input_val in ['""', "''"]:
79 return ''
66 80
67 81 @classmethod
68 82 def _dir_func(cls, input_val, ensure_dir=False, mode=0o755):
@@ -148,10 +162,12 b' class SettingsMaker:'
148 162 parser_func = {
149 163 'bool': self._bool_func,
150 164 'int': self._int_func,
165 'float': self._float_func,
151 166 'list': self._list_func,
152 167 'list:newline': functools.partial(self._list_func, sep='/n'),
153 168 'list:spacesep': functools.partial(self._list_func, sep=' '),
154 169 'string': functools.partial(self._string_func, lower=lower),
170 'string:noquote': functools.partial(self._string_no_quote_func, lower=lower),
155 171 'dir': self._dir_func,
156 172 'dir:ensured': functools.partial(self._dir_func, ensure_dir=True),
157 173 'file': self._file_path_func,
@@ -716,7 +716,7 b' def sanitize_settings_and_apply_defaults'
716 716 settings_maker.make_setting('pyramid.default_locale_name', 'en')
717 717 settings_maker.make_setting('locale', 'en_US.UTF-8')
718 718
719 settings_maker.make_setting('core.binary_dir', '/usr/local/bin/rhodecode_bin/vcs_bin')
719 settings_maker.make_setting('core.binary_dir', '/usr/local/bin/rhodecode_bin/vcs_bin', parser='string:noquote')
720 720
721 721 temp_store = tempfile.gettempdir()
722 722 default_cache_dir = os.path.join(temp_store, 'rc_cache')
General Comments 0
You need to be logged in to leave comments. Login now