Projet

Général

Profil

0001-hobo-remove-None-options-from-site-options.cfg-49147.patch

Frédéric Péters, 05 décembre 2020 09:16

Télécharger (1,61 ko)

Voir les différences:

Subject: [PATCH] hobo: remove None options from site-options.cfg (#49147)

 tests/test_hobo.py     | 5 +++++
 wcs/ctl/check_hobos.py | 3 +++
 2 files changed, 8 insertions(+)
tests/test_hobo.py
246 246
    self_domain = urlparse.urlsplit(service.get('base_url')).netloc
247 247
    assert pub.get_site_option(self_domain, 'wscall-secrets') != '0'
248 248

  
249
    service['variables']['xxx'] = None
250
    hobo_cmd.configure_site_options(service, pub, ignore_timestamp=True)
251
    pub.load_site_options()
252
    assert pub.get_site_option('xxx', 'variables') is None
253

  
249 254

  
250 255
def test_update_configuration():
251 256
    service = [x for x in HOBO_JSON.get('services', []) if x.get('service-id') == 'wcs'][0]
wcs/ctl/check_hobos.py
444 444
                config.add_section('variables')
445 445
            for key, value in variables.items():
446 446
                key = force_str(key)
447
                if value is None:
448
                    config.remove_option('variables', key)
449
                    continue
447 450
                if not isinstance(value, six.string_types):
448 451
                    value = str(value)
449 452
                value = force_str(value)
450
-