Projet

Général

Profil

Révision 3e015885

ID3e01588570e3c9d03302570a53958b14b5e355c0
Parent 9c995590
Enfant c10eaf60

Ajouté par Ondřej Nový il y a presque 5 ans

Plugin timesync_status: Handle value 0 correctly

Voir les différences:

plugins/systemd/timesync_status
57 57
    if ' ' in value:
58 58
        return sum(parse_time(x) for x in value.split(' '))
59 59

  
60
    # If time is exactly zero (for example Jitter), there is no unit (suffix)
61
    if value == "0" or value == "-0":
62
        return 0
63

  
60 64
    match = re.match(r'^([+-]?[0-9.]+)([a-z]+)$', value)
61 65
    if not match:
62 66
        raise ValueError('Invalid time ' + value)

Formats disponibles : Unified diff