- return not self.data.has_option(
- "__control__", "read_only"
- ) or not self.data.getboolean(
- "__control__", "read_only"
- )
+ # TODO(fungi): remove this indirection after the YAML transition
+ if self._format == "yaml":
+ try:
+ return not self.data["__control__"].get("read_only", False)
+ except KeyError:
+ return True
+ else:
+ return not self.data.has_option(
+ "__control__", "read_only"
+ ) or not self.data.getboolean(
+ "__control__", "read_only"
+ )