Project

General

Profile

Actions

Bug #51369

closed

vstart_runner: use FileNotFoundError instead of OSError

Added by Rishabh Dave almost 3 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

100%

Source:
Tags:
backport_processed
Backport:
pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Found a py3 compatibility-related TODO in vstart_runner.py's clear_old_log() -

    from os import stat

    try:
        stat(logpath)
    # would need an update when making this py3 compatible. Use FileNotFound
    # instead.
    except OSError:
        return
    else:
        os.remove(logpath)
        with open(logpath, 'w') as logfile:
            logfile.write('')
        init_log()
        log.debug('logging in a fresh file now...')

Related issues 1 (0 open1 closed)

Copied to Ceph - Backport #51653: pacific: vstart_runner: use FileNotFoundError instead of OSErrorResolvedKonstantin ShalyginActions
Actions

Also available in: Atom PDF