'Remove a directory if it\'s empty'

def remove_dir(self, sftp, path):

    if (sftp.exists(path) and (not sftp.listdir(path))):
        log.debug((u'Attempting    to    delete    directory    %s' % path))
        try:
            sftp.rmdir(path)
        except Exception as e:
            log.error((u'Failed    to    delete    directory    %s    (%s)' % (path, e)))
