'Processes and validates the CLI given target and adapts it for
policy authorization.
:returns: None if the given target is None, otherwise returns a proper
authorization target.
:raises nova.exception.InvalidAttribute: if a key in the given target
is not an acceptable.
:raises nova.exception.InstanceNotFound: if \'instance_id\' is given, and
there is no instance match the id.'

def _get_target(self, context, target):

    if (not target):
        return None
    new_target = {}
    for t in target:
        (key, value) = t.split('=')
        if (key not in self._ACCEPTABLE_TARGETS):
            raise exception.InvalidAttribute(attr=key)
        new_target[key] = value
    instance_id = new_target.get('instance_id')
    if instance_id:
        admin_ctxt = nova_context.get_admin_context()
        instance = db.instance_get_by_uuid(admin_ctxt, instance_id)
        new_target = {'user_id': instance['user_id'], 'project_id': instance['project_id']}
    return new_target
