mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 22:25:23 +00:00
Improved how the statefile last modified date is updated
This commit is contained in:
parent
7bc4d133d9
commit
e0b243ba93
1 changed files with 4 additions and 1 deletions
|
@ -101,6 +101,7 @@ GPLv2
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
from random import randint
|
from random import randint
|
||||||
import re
|
import re
|
||||||
from subprocess import check_output, call, DEVNULL, CalledProcessError
|
from subprocess import check_output, call, DEVNULL, CalledProcessError
|
||||||
|
@ -231,7 +232,9 @@ def do_update_repos():
|
||||||
logging.error('Repo not found at path %s' %
|
logging.error('Repo not found at path %s' %
|
||||||
repos_conf[repo_code]['path'])
|
repos_conf[repo_code]['path'])
|
||||||
logging.debug('Updating the state file')
|
logging.debug('Updating the state file')
|
||||||
open(conf['state_file'], 'w')
|
|
||||||
|
# 'touch' the state file to update its last modified date
|
||||||
|
Path(conf['state_file']).touch()
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue