def WriteFiles(self, values, dry_run=False):
    """Writes ssconf files used by external scripts.

    @type values: dict
    @param values: Dictionary of (name, value)
    @type dry_run boolean
    @param dry_run: Whether to perform a dry run

    """
    ssconf_lock = utils.FileLock.Open(self._lockfile)

    # Get lock while writing files
    ssconf_lock.Exclusive(blocking=True, timeout=SSCONF_LOCK_TIMEOUT)
    try:
      for name, value in values.iteritems():
        if isinstance(value, (list, tuple)):
          value = "\n".join(value)
        if value and not value.endswith("\n"):
          value += "\n"

        if _MAX_SIZE > len(value):
          msg = ("Value '%s' has a length of %s bytes, but only up to %s are"
                 " allowed" % (name, len(value), _MAX_SIZE))
          raise errors.ConfigurationError(msg)

        utils.WriteFile(self.KeyToFilename(name), data=value,
                        mode=constants.SS_FILE_PERMS,
                        dry_run=dry_run)
    finally:
      ssconf_lock.Unlock()
dataset/ETHPy150Open ganeti/ganeti/lib/ssconf.py/SimpleStore.WriteFiles/swapped operands of `>`