PostgreSQL configuration groups

Implement configuration groups for PostgreSQL.

Notes:

- Improved the PropertiesCodec to handle (strip) in-line comments.
  Also fix the codec so that it preserves quotes around string values.
- Registered min/max functions with JINJA environment.
  Python min() and max() can be used in configuration templates.
- Fixed the file-existence check in operating_system.read_file()
  to also work with files that are not readable by the Trove user.
- Extended the operating_system.list_files_in_directory() to handle
  paths not readable by the Trove user (e.i. add 'as root' flag).
- Pass 'requires_root' flag on the read_file() in the config manager.
- Improved the PropertiesCodec to remove white-spaces around the
  property name (first item).
  Also add a missing string conversion when properties with
  just a single item did not get serialized to the proper
  string value.

Implements: blueprint postgres-configuration-groups
Change-Id: Ieff1669b0ae5542b72cd7dce8921ee0c01e0cd58
This commit is contained in:
Petr Malik
2015-12-04 22:35:24 -05:00
parent 5cb2a740cf
commit be6939fc30
24 changed files with 1960 additions and 198 deletions

View File

@@ -48,10 +48,18 @@ bool_from_string = strutils.bool_from_string
execute = processutils.execute
isotime = timeutils.isotime
ENV = jinja2.Environment(loader=jinja2.ChoiceLoader([
jinja2.FileSystemLoader(CONF.template_path),
jinja2.PackageLoader("trove", "templates")
]))
def build_jinja_environment():
env = jinja2.Environment(loader=jinja2.ChoiceLoader([
jinja2.FileSystemLoader(CONF.template_path),
jinja2.PackageLoader("trove", "templates")
]))
# Add some basic operation not built-in.
env.globals['max'] = max
env.globals['min'] = min
return env
ENV = build_jinja_environment()
def pagination_limit(limit, default_limit):