def stage_files(update_files):
    tmp_suffix = '%d.tmp~' % os.getpid()

    for filepath, data in update_files.items():
        if os.path.exists(filepath):
            # If the data is the same, skip it, nothing to do
            if data == open(filepath).read():
                logging.info("skipping %s (no changes)" % filepath)
                del update_files[filepath]
                continue

        logging.info("staging %s (%s)" % (filepath, tmp_suffix))

        tmp_file = (filepath, tmp_suffix) % '%s.%s'
        f = open(tmp_file, 'w')
        try:
            f.write(data)
            f.close()

            os.chown(tmp_file, 0, 0)
            os.chmod(tmp_file, 0644)
        except:
            os.unlink(tmp_file)
            raise
dataset/ETHPy150Open rackerlabs/openstack-guest-agents-unix/commands/network.py/stage_files/swapped operands of `%`