Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
deca277d
Unverified
Commit
deca277d
authored
5 years ago
by
Jorik Schellekens
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Let synctl use a config directory. (#5904)
* Let synctl use a config directory.
parent
71fc0406
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/5904.feature
+1
-0
1 addition, 0 deletions
changelog.d/5904.feature
synapse/config/__init__.py
+4
-3
4 additions, 3 deletions
synapse/config/__init__.py
synctl
+10
-3
10 additions, 3 deletions
synctl
with
15 additions
and
6 deletions
changelog.d/5904.feature
0 → 100644
+
1
−
0
View file @
deca277d
Let
synctl
accept
a
directory of config files.
This diff is collapsed.
Click to expand it.
synapse/config/__init__.py
+
4
−
3
View file @
deca277d
...
...
@@ -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
# export ConfigError if somebody does import *
# export ConfigError and find_config_files if somebody does
# import *
# this is largely a fudge to stop PEP8 moaning about the import
__all__
=
[
"
ConfigError
"
]
__all__
=
[
"
ConfigError
"
,
"
find_config_files
"
]
This diff is collapsed.
Click to expand it.
synctl
+
10
−
3
View file @
deca277d
...
...
@@ -30,6 +30,8 @@ from six import iteritems
import
yaml
from
synapse.config
import
find_config_files
SYNAPSE
=
[
sys
.
executable
,
"
-B
"
,
"
-m
"
,
"
synapse.app.homeserver
"
]
GREEN
=
"
\x1b
[1;32m
"
...
...
@@ -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 be
"
"
a directory with *.yaml files
"
,
)
parser
.
add_argument
(
"
-w
"
,
"
--worker
"
,
metavar
=
"
WORKERCONFIG
"
,
help
=
"
start or stop a single worker
"
...
...
@@ -176,8 +179,12 @@ def main():
)
sys
.
exit
(
1
)
with
open
(
configfile
)
as
stream
:
config
=
yaml
.
safe_load
(
stream
)
config_files
=
find_config_files
([
configfile
])
config
=
{}
for
config_file
in
config_files
:
with
open
(
config_file
)
as
file_stream
:
yaml_config
=
yaml
.
safe_load
(
file_stream
)
config
.
update
(
yaml_config
)
pidfile
=
config
[
"
pid_file
"
]
cache_factor
=
config
.
get
(
"
synctl_cache_factor
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment