def reset_password(self, new_password=None): """ Reset password for PostgreSQL user 'scalr'. Return new password """ if not new_password: new_pass = pwgen(10) pg = postgresql_svc.PostgreSql() pg.root_user.change_role_password(new_pass) pg.root_user.change_system_password(new_pass) pg.reload() return new_pass
def reset_password(self, new_password=None): """ Reset password for PostgreSQL user 'scalr_master'. Return new password """ if not new_password: new_password = pwgen(10) pg = postgresql_svc.PostgreSql() if pg.master_user.exists(): pg.master_user.change_role_password(new_password) pg.master_user.change_system_password(new_password) else: pg.create_linux_user(pg.master_user.name, new_password) pg.create_pg_role(pg.master_user.name, new_password, super=True, force=False) return new_password
def __init__(self): self.postgresql = postgresql_svc.PostgreSql() # ? self.service = postgresql_svc.PgSQLInitScript()
def __init__(self): self._op_api = operation.OperationAPI() self.postgresql = postgresql_svc.PostgreSql() #?
def __init__(self): self._op_api = operation.OperationAPI() self.postgresql = postgresql_svc.PostgreSql() #? self.service = postgresql_svc.PgSQLInitScript()