using per-resource cache expiration_time fails

Bug #1727860 reported by Daniel Speichert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Shade
New
Undecided
Unassigned

Bug Description

clouds.yaml:

cache:
    class: dogpile.cache.dbm
    expiration_time: 3600
    arguments:
        filename: /tmp/os-shade-cache.dbm
    expiration:
        servers: 0
        flavors: 3600
        images: 3600
        networks: 3600
        floating_ips: 3600
        ports: 3600
        volumes: 3600

I identified two issues here:

1. Examples online say that under "expiraton", a singular form should be used ("server", "image"), yet shade is looking for plural, according to function names: https://github.com/openstack-infra/shade/blob/1d16f64fbf376a956cafed1b3edd8e51ccc16f2c/shade/openstackcloud.py#L249

2. The value in seconds is read from os_client_config as a string in
https://github.com/openstack-infra/shade/blob/1d16f64fbf376a956cafed1b3edd8e51ccc16f2c/shade/openstackcloud.py#L251

Therefore, this happens:

2017-10-26 16:48:39.501 41343 CRITICAL test [-] Unhandled error: dogpile.cache.exception.ValidationError: expiration_time is not a number or timedelta.
2017-10-26 16:48:39.501 41343 ERROR test Traceback (most recent call last):
2017-10-26 16:48:39.501 41343 ERROR test File "/root/venv/bin/sync", line 10, in <module>
2017-10-26 16:48:39.501 41343 ERROR test sys.exit(main())
2017-10-26 16:48:39.501 41343 ERROR test File "/root/test/main.py", line 34, in main
2017-10-26 16:48:39.501 41343 ERROR test cloud = shade.openstack_cloud(cloud=CONF.os_cloud, app_name=DOMAIN, region_name=CONF.os_region_name)
2017-10-26 16:48:39.501 41343 ERROR test File "/root/venv/lib/python3.6/site-packages/shade/__init__.py", line 113, in openstack_cloud
2017-10-26 16:48:39.501 41343 ERROR test return OpenStackCloud(cloud_config=cloud_config, strict=strict)
2017-10-26 16:48:39.501 41343 ERROR test File "/root/venv/lib/python3.6/site-packages/shade/openstackcloud.py", line 253, in __init__
2017-10-26 16:48:39.501 41343 ERROR test cache_class, expirations[expire_key], cache_arguments)
2017-10-26 16:48:39.501 41343 ERROR test File "/root/venv/lib/python3.6/site-packages/shade/openstackcloud.py", line 315, in _make_cache
2017-10-26 16:48:39.501 41343 ERROR test arguments=arguments)
2017-10-26 16:48:39.501 41343 ERROR test File "/root/venv/lib/python3.6/site-packages/dogpile/cache/region.py", line 435, in configure
2017-10-26 16:48:39.501 41343 ERROR test 'expiration_time is not a number or timedelta.')
2017-10-26 16:48:39.501 41343 ERROR test dogpile.cache.exception.ValidationError: expiration_time is not a number or timedelta.

Line 251 above simply needs to have: int(expirations[expire_key])

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.