hobo: remove None options from site-options.cfg (#49147)
This commit is contained in:
parent
ada843ca55
commit
191937edc9
|
@ -246,6 +246,11 @@ def test_configure_site_options():
|
|||
self_domain = urlparse.urlsplit(service.get('base_url')).netloc
|
||||
assert pub.get_site_option(self_domain, 'wscall-secrets') != '0'
|
||||
|
||||
service['variables']['xxx'] = None
|
||||
hobo_cmd.configure_site_options(service, pub, ignore_timestamp=True)
|
||||
pub.load_site_options()
|
||||
assert pub.get_site_option('xxx', 'variables') is None
|
||||
|
||||
|
||||
def test_update_configuration():
|
||||
service = [x for x in HOBO_JSON.get('services', []) if x.get('service-id') == 'wcs'][0]
|
||||
|
|
|
@ -444,6 +444,9 @@ class CmdCheckHobos(Command):
|
|||
config.add_section('variables')
|
||||
for key, value in variables.items():
|
||||
key = force_str(key)
|
||||
if value is None:
|
||||
config.remove_option('variables', key)
|
||||
continue
|
||||
if not isinstance(value, six.string_types):
|
||||
value = str(value)
|
||||
value = force_str(value)
|
||||
|
|
Loading…
Reference in New Issue