Comment 2 for bug 912143

Tihomir Trifonov (ttrifonov) wrote :

Hello,

I've added this as a comment to another bug, but now I've found that is reported as a bug itself.

QUOTE:
There is something strange here. I am using devstack setup, and for me the 'update_email' function is not working.

    def update_email(self, user, email):
        """
        Update email
        """
        # FIXME(ja): why do we have to send id in params and url?
        params = {"user": {"id": base.getid(user),
                           "email": email}}

        return self._update("/users/%s" % base.getid(user), params, "user")

This is the function in python-keystoneclient, where self._update is :

    def _update(self, url, body, response_key=None):
        resp, body = self.api.put(url, body=body)
        # PUT requests may not return a body
        if body:
            return self.resource_class(self, body[response_key])

an actual *PUT* request.

But, as I see in keystone/keystone/contrib/extensions/admin/osksadm/__init__.py

        mapper.connect("/users/{user_id}",
                    controller=user_controller,
                    action="update_user",
                    conditions=dict(method=["POST"]))
        mapper.connect("/users/{user_id}",

This supports only POST and not PUT.