def migrate_legacy_obj(legacy_guid_file):
    logger.info('Migrating legacy Guid {0}'.format(legacy_guid_file._id))
    storage_obj = get_or_create_storage_file(
        legacy_guid_file.node,
        legacy_guid_file.name,
        _id=legacy_guid_file._id,
    )
    guid_obj = Guid.load(legacy_guid_file._id)
    guid_obj.referent = storage_obj
    guid_obj.save()

    return storage_obj
This method handles SIGINT and SIGTERM signals.
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/osfstorage/migrate_guids.py/migrate_legacy_obj--crossover with--dataset/ETHPy150Open comodit/synapse-agent/synapse/dispatcher.py/Dispatcher.stop