'Returns a legacy filter_properties dict from the RequestSpec object.
Since we need to manage backwards compatibility and rolling upgrades
within our RPC API, we need to accept to provide an helper for
primitiving the right RequestSpec object into a legacy dict until we
drop support for old Scheduler RPC API versions.
If you don\'t understand why this method is needed, please don\'t use it.'

def to_legacy_filter_properties_dict(self):

    filt_props = {}
    if (self.obj_attr_is_set('ignore_hosts') and self.ignore_hosts):
        filt_props['ignore_hosts'] = self.ignore_hosts
    if (self.obj_attr_is_set('force_hosts') and self.force_hosts):
        filt_props['force_hosts'] = self.force_hosts
    if (self.obj_attr_is_set('force_nodes') and self.force_nodes):
        filt_props['force_nodes'] = self.force_nodes
    if (self.obj_attr_is_set('retry') and self.retry):
        filt_props['retry'] = self.retry.to_dict()
    if (self.obj_attr_is_set('limits') and self.limits):
        filt_props['limits'] = self.limits.to_dict()
    if (self.obj_attr_is_set('instance_group') and self.instance_group):
        filt_props.update(self._to_legacy_group_info())
    if (self.obj_attr_is_set('scheduler_hints') and self.scheduler_hints):
        filt_props['scheduler_hints'] = {hint: self.get_scheduler_hint(hint) for hint in self.scheduler_hints}
    return filt_props
