~billy-olsen/maas/lp1484696-proxypass-websockets-1.9

« back to all changes in this revision

Viewing changes to src/provisioningserver/testing/config.py

[r=allenap][bug=1524007][author=allenap] Backport of r4551 from lp:maas: By default, open configuration files read-only.

This eliminates the need for locking when using the YAML-based back-end.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        self.path = path.join(
104
104
            self.useFixture(TempDirectory()).path,
105
105
            path.basename(self.configuration.DEFAULT_FILENAME))
106
 
        with self.configuration.open(self.path) as config:
 
106
        with self.configuration.open_for_update(self.path) as config:
107
107
            for key, value in self.options.viewitems():
108
108
                setattr(config, key, value)
109
109
        # Export this filename to the environment, so that subprocesses will