@@ -287,6 +287,13 @@ def __init__(self, project, environment=None):
287
287
def record_command (self , command ):
288
288
pass
289
289
290
+ def _log_warn_only (self , msg ):
291
+ log .warn (LOG_TEMPLATE .format (
292
+ project = self .project .slug ,
293
+ version = 'latest' ,
294
+ msg = msg ,
295
+ ))
296
+
290
297
def run (self , * cmd , ** kwargs ):
291
298
"""Shortcut to run command from environment."""
292
299
return self .run_command_class (cls = self .command_class , cmd = cmd , ** kwargs )
@@ -332,11 +339,7 @@ def run_command_class(self, cls, cmd, warn_only=False, **kwargs):
332
339
msg += u':\n {out}' .format (out = build_cmd .output )
333
340
334
341
if warn_only :
335
- # TODO: remove version dependency to log here
336
- log .warn (LOG_TEMPLATE
337
- .format (project = self .project .slug ,
338
- version = self .version .slug ,
339
- msg = msg ))
342
+ self ._log_warn_only (msg )
340
343
else :
341
344
raise BuildEnvironmentWarning (msg )
342
345
return build_cmd
@@ -434,6 +437,14 @@ def record_command(self, command):
434
437
if self .record :
435
438
command .save ()
436
439
440
+ def _log_warn_only (self , msg ):
441
+ # :'(
442
+ log .warn (LOG_TEMPLATE .format (
443
+ project = self .project .slug ,
444
+ version = self .version .slug ,
445
+ msg = msg ,
446
+ ))
447
+
437
448
def run (self , * cmd , ** kwargs ):
438
449
kwargs .update ({
439
450
'build_env' : self ,
0 commit comments