Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Let synctl use a config directory. #5904

Merged
merged 6 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5904.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let synctl accept a directory of config files.
7 changes: 4 additions & 3 deletions synapse/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ._base import ConfigError
from ._base import ConfigError, find_config_files, read_config_files

# export ConfigError if somebody does import *
# export ConfigError, find_cofig_files, read_config_files if somebody does
JorikSchellekens marked this conversation as resolved.
Show resolved Hide resolved
# import *
# this is largely a fudge to stop PEP8 moaning about the import
__all__ = ["ConfigError"]
__all__ = ["ConfigError", "find_config_files", "read_config_files"]
8 changes: 5 additions & 3 deletions synctl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ from six import iteritems

import yaml

from synapse.config import find_config_files, read_config_files

SYNAPSE = [sys.executable, "-B", "-m", "synapse.app.homeserver"]

GREEN = "\x1b[1;32m"
Expand Down Expand Up @@ -135,7 +137,8 @@ def main():
"configfile",
nargs="?",
default="homeserver.yaml",
help="the homeserver config file, defaults to homeserver.yaml",
help="the homeserver config file, defaults to homeserver.yaml, may also specify"
JorikSchellekens marked this conversation as resolved.
Show resolved Hide resolved
" a directory with *.yaml files",
)
parser.add_argument(
"-w", "--worker", metavar="WORKERCONFIG", help="start or stop a single worker"
Expand Down Expand Up @@ -176,8 +179,7 @@ def main():
)
sys.exit(1)

with open(configfile) as stream:
config = yaml.safe_load(stream)
config = read_config_files(find_config_files([configfile]))
JorikSchellekens marked this conversation as resolved.
Show resolved Hide resolved

pidfile = config["pid_file"]
cache_factor = config.get("synctl_cache_factor")
Expand Down