<pre>
try:
    hypervisor = hypervisors[name]
except KeyError:
    ...
</pre>