hobos: gently skip uptodate sites (#5939)

This commit is contained in:
Frédéric Péters 2014-11-14 13:53:52 +01:00
parent fe3cb16472
commit 2086aad715
1 changed files with 16 additions and 1 deletions

View File

@ -26,6 +26,10 @@ from qommon.ctl import Command
from qommon.storage import atomic_write
class NoChange(Exception):
pass
class CmdCheckHobos(Command):
name = 'check-hobos'
@ -63,7 +67,12 @@ class CmdCheckHobos(Command):
pub.set_config()
new_site = False
self.configure_site_options(service, pub)
try:
self.configure_site_options(service, pub)
except NoChange:
print ' skipping'
continue
self.update_configuration(service, pub)
self.configure_authentication_methods(service, pub)
if new_site:
@ -141,6 +150,12 @@ class CmdCheckHobos(Command):
if os.path.exists(site_options_filepath):
config.read(site_options_filepath)
try:
if config.getint('hobo', 'timestamp') == self.all_services.get('timestamp'):
raise NoChange()
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
pass
if not 'hobo' in config.sections():
config.add_section('hobo')
config.set('hobo', 'timestamp', self.all_services.get('timestamp'))