Example #1
0
    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
Example #2
0
 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
Example #3
0
 def __init__(self):
     self.postgresql = postgresql_svc.PostgreSql()  # ?
     self.service = postgresql_svc.PgSQLInitScript()
Example #4
0
 def __init__(self):
     self._op_api = operation.OperationAPI()
     self.postgresql = postgresql_svc.PostgreSql()  #?
Example #5
0
 def __init__(self):
     self._op_api = operation.OperationAPI()
     self.postgresql = postgresql_svc.PostgreSql()  #?
     self.service = postgresql_svc.PgSQLInitScript()