Projet

Général

Profil

0001-hobos-gently-skip-over-uptodate-sites-5939.patch

Frédéric Péters, 14 novembre 2014 13:54

Télécharger (1,76 ko)

Voir les différences:

Subject: [PATCH] hobos: gently skip over uptodate sites (#5939)

 wcs/ctl/check_hobos.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
wcs/ctl/check_hobos.py
27 27
from qommon.storage import atomic_write
28 28

  
29 29

  
30
class NoChange(Exception):
31
    pass
32

  
33

  
30 34
class CmdCheckHobos(Command):
31 35
    name = 'check-hobos'
32 36

  
......
63 67
                print 'updating instance in', pub.app_dir
64 68
                pub.set_config()
65 69

  
66
            self.configure_site_options(service, pub)
70
            try:
71
                self.configure_site_options(service, pub)
72
            except NoChange:
73
                print '  skipping'
74
                continue
75

  
67 76
            self.update_configuration(service, pub)
68 77
            self.configure_authentication_methods(service, pub)
69 78
            self.configure_sql(service, pub)
......
140 149
        if os.path.exists(site_options_filepath):
141 150
            config.read(site_options_filepath)
142 151

  
152
        try:
153
            if config.getint('hobo', 'timestamp') == self.all_services.get('timestamp'):
154
                raise NoChange()
155
        except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
156
            pass
157

  
143 158
        if not 'hobo' in config.sections():
144 159
            config.add_section('hobo')
145 160
        config.set('hobo', 'timestamp', self.all_services.get('timestamp'))
146
-