@plug.handler()
def upload_file(metadata, content):
    plug.logger.debug(u"Uploading file {}", metadata.path)
    try:
        f = sftp.open(metadata.path, 'w+')
        f.write(content)
        f.close()
    except (IOError, __HOLE__) as e:
        raise ServiceError("Error writing file '{}': {}"
                           .format(metadata.path, e))
    plug.logger.debug(u"Uploading file {} - Done", metadata.path)
dataset/ETHPy150Open onitu/onitu/drivers/sftp/onitu_sftp/sftp.py/upload_file