'rename(old, new)'

def rename(self, old, new):

    old = Hdfs.normpath(old)
    if (not new.startswith('/')):
        new = Hdfs.join(Hdfs.dirname(old), new)
    new = Hdfs.normpath(new)
    params = self._getparams()
    params['op'] = 'RENAME'
    params['destination'] = smart_str(new)
    result = self._root.put(old, params)
    if (not result['boolean']):
        raise IOError((_('Rename    failed:    %s    ->    %s') % (str(smart_str(old)), str(smart_str(new)))))
