Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf9ce8e5b6 | ||
|
|
b92edc02f5 | ||
|
|
f50bfbc60d |
No files matched your search
@@ -579,8 +579,12 @@ class Installer:
|
||||
f"amqp://coulobre:{self.state['broker_password']}@127.0.0.1:5672/coulobre"
|
||||
),
|
||||
"COULOBRE_LOCAL_DATABASE_PROVISIONING": "1",
|
||||
"COULOBRE_SERVICE_HEALTH": json.dumps(
|
||||
{"panel": {"local": services}}, separators=(",", ":")
|
||||
"COULOBRE_SERVICE_HEALTH": (
|
||||
"'"
|
||||
+ json.dumps(
|
||||
{"panel": {"local": services}}, separators=(",", ":")
|
||||
)
|
||||
+ "'"
|
||||
),
|
||||
}
|
||||
if self.php:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import fcntl
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
@@ -16,6 +17,8 @@ from tempfile import TemporaryDirectory
|
||||
|
||||
from .release_updates import UpdateError, download_wheel, selected_release
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SOCKET = Path("/run/coulobre-update.sock")
|
||||
STATE = Path("/var/lib/coulobre-update")
|
||||
STATUS = STATE / "status.json"
|
||||
@@ -96,6 +99,14 @@ def publish_status(status, state, message):
|
||||
os.fsync(directory)
|
||||
finally:
|
||||
os.close(directory)
|
||||
if state != "running":
|
||||
LOGGER.info(
|
||||
"Update %s for %s requested by %s. %s",
|
||||
state,
|
||||
status.get("target_version"),
|
||||
status.get("actor"),
|
||||
message,
|
||||
)
|
||||
|
||||
|
||||
def display_status():
|
||||
@@ -453,6 +464,12 @@ def handle_request(peer):
|
||||
"target_version": request["version"],
|
||||
"actor": request["actor"],
|
||||
}
|
||||
LOGGER.info(
|
||||
"Update from %s to %s requested by %s.",
|
||||
installed,
|
||||
status["target_version"],
|
||||
status["actor"],
|
||||
)
|
||||
try:
|
||||
hostname = check_installation()
|
||||
except UpdateError as error:
|
||||
@@ -465,6 +482,7 @@ def handle_request(peer):
|
||||
|
||||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO, format="%(message)s")
|
||||
with socket.socket(fileno=0) as peer:
|
||||
try:
|
||||
handle_request(peer)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import shlex
|
||||
import stat
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -69,7 +70,7 @@ class InstallerParametersTests(unittest.TestCase):
|
||||
"rabbitmq",
|
||||
]
|
||||
self.assertEqual(
|
||||
json.loads(env["COULOBRE_SERVICE_HEALTH"]),
|
||||
json.loads(shlex.split(env["COULOBRE_SERVICE_HEALTH"])[0]),
|
||||
{"panel": {"local": base + extras}},
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user