Skip to content

Commit 8c0f4f0

Browse files
committed
Added checks for the presence of yang module directories to the check framework. Tweaked some text strings.
- Legacy-Id: 13720
1 parent 13905a2 commit 8c0f4f0

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

ietf/checks.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def check_id_submission_directories(app_configs, **kwargs):
112112
"in the settings file. The setting is:\n"
113113
" %s = %s" % (s, p),
114114
hint = ("Please either update the local settings to point at the correct directory,"
115-
"or if the setting is correct, create the directory."),
115+
"or if the setting is correct, create the indicated directory."),
116116
id = "datatracker.E0006",
117117
))
118118
return errors
@@ -137,6 +137,28 @@ def check_id_submission_files(app_configs, **kwargs):
137137
))
138138
return errors
139139

140+
141+
@checks.register('directories')
142+
def check_yang_model_directories(app_configs, **kwargs):
143+
#
144+
if already_ran():
145+
return []
146+
#
147+
errors = []
148+
for s in ("SUBMIT_YANG_RFC_MODEL_DIR", "SUBMIT_YANG_DRAFT_MODEL_DIR", "SUBMIT_YANG_INVAL_MODEL_DIR", ):
149+
p = getattr(settings, s)
150+
if not os.path.exists(p):
151+
errors.append(checks.Critical(
152+
"A directory used by the yang validation tools does not exist at the path\n"
153+
"gvien in the settings file. The setting is:\n"
154+
" %s = %s" % (s, p),
155+
hint = ("Please either update your local settings to point at the correct directory,"
156+
"or if the setting is correct, create the indicated directory."),
157+
id = "datatracker.E0006",
158+
))
159+
return errors
160+
161+
140162
@checks.register('submission-checkers')
141163
def check_id_submission_checkers(app_configs, **kwargs):
142164
#
@@ -199,7 +221,7 @@ def check_media_directories(app_configs, **kwargs):
199221
"in the settings file. The setting is:\n"
200222
" %s = %s" % (s, p),
201223
hint = ("Please either update the local settings to point at the correct directory,"
202-
"or if the setting is correct, create the directory."),
224+
"or if the setting is correct, create the indicated directory."),
203225
id = "datatracker.E0012",
204226
))
205227
return errors
@@ -220,7 +242,7 @@ def check_proceedings_directories(app_configs, **kwargs):
220242
"in the settings file. The setting is:\n"
221243
" %s = %s" % (s, p),
222244
hint = ("Please either update the local settings to point at the correct directory,"
223-
"or if the setting is correct, create the directory."),
245+
"or if the setting is correct, create the indicated directory."),
224246
id = "datatracker.E0013",
225247
))
226248
return errors

0 commit comments

Comments
 (0)