Skip to content

Commit

Permalink
Revisionism
Browse files Browse the repository at this point in the history
  • Loading branch information
dbutenhof committed Apr 4, 2023
1 parent 7ac1626 commit ee1cf97
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
14 changes: 7 additions & 7 deletions lib/pbench/cli/server/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ def run_gunicorn(server_config: PbenchServerConfig, logger: Logger) -> int:
try:
wait_for_uri(db_uri, db_wait_timeout)
except BadConfig as exc:
logger.error(f"{exc}")
notifier.notify("STOPPING=1")
notifier.notify(f"STATUS=Bad DB config {exc}")
logger.error(f"{exc}")
return 1
except ConnectionRefusedError:
logger.error("Database {} not responding", db_uri)
notifier.notify("STOPPING=1")
notifier.notify("STATUS=DB not responding")
logger.error("Database {} not responding", db_uri)
return 1

notifier.notify("STATUS=Waiting for Elasticsearch instance")
Expand All @@ -96,23 +96,23 @@ def run_gunicorn(server_config: PbenchServerConfig, logger: Logger) -> int:
try:
wait_for_uri(es_uri, es_wait_timeout)
except BadConfig as exc:
logger.error(f"{exc}")
notifier.notify("STOPPING=1")
notifier.notify(f"STATUS=Bad index config {exc}")
logger.error(f"{exc}")
return 1
except ConnectionRefusedError:
logger.error("Index {} not responding", es_uri)
notifier.notify("STOPPING=1")
notifier.notify("STATUS=Index service not responding")
logger.error("Index {} not responding", es_uri)
return 1

notifier.notify("STATUS=Initializing OIDC")
try:
oidc_server = OpenIDClient.wait_for_oidc_server(server_config, logger)
except OpenIDClient.NotConfigured as exc:
logger.warning("OpenID Connect client not configured, {}", exc)
notifier.notify("STOPPING=1")
notifier.notify("STATUS=OPENID broker not responding")
logger.warning("OpenID Connect client not configured, {}", exc)
else:
logger.info("Pbench server using OIDC server {}", oidc_server)

Expand All @@ -126,9 +126,9 @@ def run_gunicorn(server_config: PbenchServerConfig, logger: Logger) -> int:
try:
init_db(server_config, logger)
except (NoOptionError, NoSectionError) as exc:
logger.error("Invalid database configuration: {}", exc)
notifier.notify("STOPPING=1")
notifier.notify(f"STATUS=Error initializing database: {exc}")
logger.error("Invalid database configuration: {}", exc)
return 1

# Multiple cron jobs will attempt to file reports with the Elasticsearch
Expand All @@ -141,9 +141,9 @@ def run_gunicorn(server_config: PbenchServerConfig, logger: Logger) -> int:
try:
init_indexing(PROG, server_config, logger)
except (NoOptionError, NoSectionError) as exc:
logger.error("Invalid indexing configuration: {}", exc)
notifier.notify("STOPPING=1")
notifier.notify(f"STATUS=Invalid indexing config {exc}")
logger.error("Invalid indexing configuration: {}", exc)
return 1

notifier.notify("READY=1")
Expand Down
3 changes: 0 additions & 3 deletions lib/pbench/test/unit/server/test_shell_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def get_server_config() -> PbenchServerConfig:
"wait_timeout",
"workers",
"worker_timeout",
"crontab-dir",
],
)
def test_main_server_config_no_option(
Expand All @@ -329,8 +328,6 @@ def get_server_config() -> PbenchServerConfig:
section = (
"database"
if option in frozenset(("uri", "wait_timeout"))
else "DEFAULT"
if option == "crontab-dir"
else "pbench-server"
)
make_logger.error(config._conf[section][option])
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions server/pbenchinacan/container-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ buildah copy --chown root:root --chmod 0644 $container \
buildah run $container rm /etc/logrotate.d/nginx

# Setup the Pbench Server systemd service.
buildah run $container cp ${SERVER_LIB}/systemd/pbench-server.service \
/etc/systemd/system/pbench-server.service
buildah run $container cp ${SERVER_LIB}/pbench/system/pbench-index.service \
${SERVER_LIB}/pbench/system/pbench-index.timer \
buildah run $container cp \
${SERVER_LIB}/systemd/pbench-server.service \
${SERVER_LIB}/systemd/pbench-index.service \
${SERVER_LIB}/systemd/pbench-index.timer \
/etc/systemd/system/

buildah run $container systemctl enable nginx
Expand Down

0 comments on commit ee1cf97

Please sign in to comment.