Page MenuHomePhabricator
Paste P96516

(An Untitled Masterwork)
ActivePublic

Authored by CWilliams-WMF on Wed, Sep 23, 5:14 PM.
Project Tags
Referenced Files
F104455572: raw-paste-data.txt
Wed, Sep 23, 5:14 PM
Subscribers
None
diff --git a/spicerack/mysql.py b/spicerack/mysql.py
index 941b05a..6a98110 100644
--- a/spicerack/mysql.py
+++ b/spicerack/mysql.py
@@ -7,6 +7,7 @@ from dataclasses import dataclass
from datetime import UTC, datetime, timedelta
from decimal import Decimal
from enum import Enum
+from os import getenv
from pathlib import Path
from time import sleep
from typing import Any, Optional, Union
@@ -26,7 +27,8 @@ from spicerack.remote import Remote, RemoteExecutionError, RemoteHosts, RemoteHo
REPLICATION_ROLES: tuple[str, ...] = ("master", "slave", "standalone")
"""Valid replication roles."""
-CORE_SECTIONS: tuple[str, ...] = (
+
+DEFAULT_CORE_SECTIONS: tuple[str, ...] = (
"s6",
"s5",
"s2",
@@ -41,6 +43,14 @@ CORE_SECTIONS: tuple[str, ...] = (
"es6",
"es7",
)
+
+CORE_SECTIONS: tuple[str, ...] = tuple(
+ getenv(
+ "SPICERACK_MYSQL_CORE_SECTIONS",
+ ",".join(DEFAULT_CORE_SECTIONS)
+ ).split(","),
+)
+
"""Valid MySQL RW core sections (external storage RO, parser cache, x2 and misc sections are not included here).
They are ordered from less impactful if anything goes wrong to most impactful.
"""