File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 13
13
CircularReference ,
14
14
ComposeFileNotFound ,
15
15
)
16
- from .validation import validate_service_names , validate_top_level_object , validate_against_schema
16
+ from .validation import (
17
+ validate_against_schema ,
18
+ validate_service_names ,
19
+ validate_top_level_object
20
+ )
17
21
18
22
19
23
DOCKER_CONFIG_KEYS = [
@@ -141,7 +145,7 @@ def load(config_details):
141
145
142
146
service_dicts = []
143
147
144
- for service_name , service_dict in list (config .items ()):
148
+ for service_name , service_dict in list (processed_config .items ()):
145
149
loader = ServiceLoader (working_dir = working_dir , filename = filename )
146
150
service_dict = loader .make_service_dict (service_name , service_dict )
147
151
validate_paths (service_dict )
Original file line number Diff line number Diff line change
1
+ from functools import wraps
1
2
import os
2
3
3
4
from docker .utils .ports import split_port
@@ -37,21 +38,25 @@ def format_ports(instance):
37
38
38
39
39
40
def validate_service_names (func ):
41
+ @wraps (func )
40
42
def func_wrapper (config ):
41
- for service_name in func ( config ) .keys ():
43
+ for service_name in config .keys ():
42
44
if type (service_name ) is int :
43
45
raise ConfigurationError (
44
46
"Service name: {} needs to be a string, eg '{}'" .format (service_name , service_name )
45
47
)
48
+ return func (config )
46
49
return func_wrapper
47
50
48
51
49
52
def validate_top_level_object (func ):
53
+ @wraps (func )
50
54
def func_wrapper (config ):
51
- if not isinstance (func ( config ) , dict ):
55
+ if not isinstance (config , dict ):
52
56
raise ConfigurationError (
53
57
"Top level object needs to be a dictionary. Check your .yml file that you have defined a service at the top level."
54
58
)
59
+ return func (config )
55
60
return func_wrapper
56
61
57
62
You can’t perform that action at this time.
0 commit comments