This is an automatically generated e-mail. To reply, visit: http://reviewboard-fedoraserver.rhcloud.com/r/219/

config/roles/databaseserver/role.py (Diff revision 3)
385
            except Exception as e:
280
                # If the subprocess returned non-zero, raise an exception
386
                # If the subprocess returned non-zero, raise an exception
281
                raise RolekitError(COMMAND_FAILED,
387
                raise RolekitError(COMMAND_FAILED,
282
                                   "Changing all connections to use md5 method in '%s' failed: %d" %
388
                    "Changing all connections to use md5 method in '{}'"
283
                                   (values['pg_hba_conf'], result.status))
389
                    "failed: {}".format(values['pg_hba_conf'], result.status))

If the __tweak_lines() routine has failed here, should we also restore the earlier .rksave for postgresql.conf? The decomission() should take care of it either way.

It might be a separate bug, but if the first deployment fails partway through (such as with one file but not the other updated) and is not decommissioned before attempting to create another instance, it's possible that we could end up in a state where the deployment looks like it succeeded but the database won't be accessible because pg_hba.conf wasn't updated.

I think we need to account for this possibility. (This was pretty much the original reasoning for bug #21)


config/roles/databaseserver/role.py (Diff revision 3)
280
                # If the subprocess returned non-zero, raise an exception
386
                # If the subprocess returned non-zero, raise an exception

This comment is no longer valid.


- Stephen Gallagher


On September 23rd, 2015, 3:17 p.m. UTC, Nils Philippsen wrote:

Review request for RoleKit Mailing List, Miloslav Trmac, Nils Philippsen, Stephen Gallagher, and Thomas Woerner.
By Nils Philippsen.

Updated Sept. 23, 2015, 3:17 p.m.

Repository: rolekit

Description

Use an internal implementation instead of calling sed to tweak
configuration files. This has the neat side effect of overwriting the
target file as the last step, side-stepping the need to copy over the
backup file on errors.

This change requires python3-slip >= 0.6.4 because in previous versions
slip.util.files.overwrite_safely() doesn't preserve file ownership, and
the postgresql configuration files need to be owned by the postgres user.

https://github.com/libre-server/rolekit/issues/21

Testing

Deployed databaseserver role, compared contents of postgresql.conf, pg_hba.conf with what the original sed commands produced.

Diffs

  • config/roles/databaseserver/role.py (7443979ba7ff87ff6a018ac8a7a0a89e2b8ad6e7)
  • rolekit.spec (f3cf9f4b799909bc293f4e56eea78c71e7112e9c)

View Diff