예제 #1
0
 def _init_pgsql(self, database):
     rc, out, err = self.shell(["service", "postgresql", "initdb"])
     if rc != 0:
         if "is not empty" not in out:
             log.error("Failed to initialize postgresql service")
             log.error("stdout:\n%s" % out)
             log.error("stderr:\n%s" % err)
             raise CommandError("service postgresql initdb", rc, out, err)
     # Always fixup postgres auth
     self._config_pgsql_auth(database)
 def _init_pgsql(self, database):
     rc, out, err = self.shell(["service", "postgresql", "initdb"])
     if rc != 0:
         if 'is not empty' not in out:
             log.error("Failed to initialize postgresql service")
             log.error("stdout:\n%s" % out)
             log.error("stderr:\n%s" % err)
             raise CommandError("service postgresql initdb", rc, out, err)
         return
     # Only mess with auth if we've freshly initialized the db
     self._config_pgsql_auth(database)
예제 #3
0
 def _init_pgsql(self, database):
     rc, out, err = self.shell(
         ["/usr/pgsql-9.6/bin/postgresql96-setup", "initdb"])
     if rc != 0:
         if "is not empty" not in out:
             log.error("Failed to initialize postgresql 9.6 database")
             log.error("stdout:\n%s" % out)
             log.error("stderr:\n%s" % err)
             raise CommandError(
                 "/usr/pgsql-9.6/bin/postgresql96-setup initdb", rc, out,
                 err)
     # Always fixup postgres auth
     self._config_pgsql_auth(database)