Whenever an admin would attempt to register a new shard, the shard was
admitted whether or not the shard URI actually existed, and whether or
not marconi could handle shards of that type.
This patch makes it so that a DataDriver instance is temporarily
instantiated prior to storing the shard entry. This instance uses
is_alive() to determine whether or not the shard can be reached/is
supported. This applies to both PUT/PATCH. HTTP 400 is returned if the
registration fails, as a result.
To enable this change, the ability to create a dynamic configuration
object was extracted from sharding.Catalog. Tests were written for
this new function.
The unit tests were updated accordingly, expanding the coverage of
test_shards to include the new failure cases.
Some changes needed to be made to handle new oslo.cache interface:
- cache.unset doesn't exist - now using cache.unset_many
- cache.get_cache() takes a URI, not a ConfigOpts
Change-Id: I40509f525466da01baad2a5aef81c7b99c8d2f97
Closes-Bug: #1258591
Closes-Bug: #1273376
Closes-Bug: #1273377