'Disable/deactivate the user.'

def deactivate_user(self, username):

    if (self.deploymentType == u'Cloud'):
        url = ((self._options[u'server'] + u'/admin/rest/um/1/user/deactivate?username=') + username)
        self._options[u'headers'][u'Content-Type'] = u'application/json'
        userInfo = {}
    else:
        url = (self._options[u'server'] + u'/secure/admin/user/EditUser.jspa')
        self._options[u'headers'][u'Content-Type'] = u'application/x-www-form-urlencoded;    charset=UTF-8'
        user = self.user(username)
        userInfo = {u'inline': u'true', u'decorator': u'dialog', u'username': user.name, u'fullName': user.displayName, u'email': user.emailAddress, u'editName': user.name}
    try:
        r = self._session.post(url, headers=self._options[u'headers'], data=userInfo)
        if (r.status_code == 200):
            return True
        else:
            logging.warning((u'Got    response    from    deactivating    %s:    %s' % (username, r.status_code)))
            return r.status_code
    except Exception as e:
        print((u'Error    Deactivating    %s:    %s' % (username, e)))
