Skip to content

Instantly share code, notes, and snippets.

@hub-cap
Created February 12, 2013 17:58
Show Gist options
  • Select an option

  • Save hub-cap/4771790 to your computer and use it in GitHub Desktop.

Select an option

Save hub-cap/4771790 to your computer and use it in GitHub Desktop.
class BackendFilter(filters.BaseHostFilter):
"""MultiBackendFilter for determining the backend to send to."""
def host_passes(self, host_state, filter_properties):
"""Return True if host has sufficient capacity."""
vol_type = host_state.volume_type
return filter_properties['volume_type']['name'] == vol_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment