From df764bfc98c969d4ab6b577f11e070bd9760899e Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 1 Aug 2017 10:26:38 +0100 Subject: [PATCH] #333 Show netdisco-do target device in log message at start --- Changes | 4 ++++ bin/netdisco-do | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 7f11fa6c..5e2539a1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ 2.036009 - 2017-07-31 + [ENHANCEMENTS] + + * #333 Show netdisco-do target device in log message at start + [BUG FIXES] * #334 DB schema is not upgraded past v40 diff --git a/bin/netdisco-do b/bin/netdisco-do index f6bca970..b374b3bb 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -241,10 +241,17 @@ foreach my $host (@hostlist) { subaction => $extra, }); + my $actiontext = ( + ($job->device ? ('['.$job->device->ip.']') : '') . + ($job->action eq 'show' ? ('/'.$job->subaction) : '') + ); + # do job my ($status, $log); try { - info sprintf '%s: started at %s', $action, scalar localtime; + + info sprintf '%s: %s started at %s', + $action, $actiontext, scalar localtime; ($status, $log) = $worker->$action($job); } catch {