Don't barf if we can't monitor all log files.
Change-Id: I6e867fe13e55da8661501c8df0cc445afbed528c
This commit is contained in:
@@ -112,13 +112,20 @@ def execute_to_log(cmd, logfile, timeout=-1,
|
|||||||
descriptors = {}
|
descriptors = {}
|
||||||
|
|
||||||
for watch_file in watch_logs:
|
for watch_file in watch_logs:
|
||||||
fd = os.open(watch_file[1], os.O_RDONLY)
|
if not os.path.exists(watch_file[1]):
|
||||||
os.lseek(fd, 0, os.SEEK_END)
|
logger.warning('Failed to monitor log file %s: file not found'
|
||||||
descriptors[fd] = dict(
|
% watch_file[1])
|
||||||
name=watch_file[0],
|
continue
|
||||||
poll=select.POLLIN,
|
|
||||||
lines=''
|
try:
|
||||||
)
|
fd = os.open(watch_file[1], os.O_RDONLY)
|
||||||
|
os.lseek(fd, 0, os.SEEK_END)
|
||||||
|
descriptors[fd] = {'name': watch_file[0],
|
||||||
|
'poll': select.POLLIN,
|
||||||
|
'lines': ''}
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning('Failed to monitor log file %s: %s'
|
||||||
|
% (watch_file[1], e))
|
||||||
|
|
||||||
cmd += ' 2>&1'
|
cmd += ' 2>&1'
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user