From 6eb26d7998ef5472ca5cfddac60b83ddffea5594 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Thu, 13 Oct 2016 14:53:50 -0400 Subject: [PATCH] configproviders: pass filemode when opening volume --- util/config/provider/baseprovider.py | 2 +- util/config/provider/fileprovider.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/config/provider/baseprovider.py b/util/config/provider/baseprovider.py index 97360d309..d3bea873e 100644 --- a/util/config/provider/baseprovider.py +++ b/util/config/provider/baseprovider.py @@ -80,7 +80,7 @@ class BaseProvider(object): """ Returns whether the file with the given name exists under the config override volume. """ raise NotImplementedError - def get_volume_file(self, filename): + def get_volume_file(self, filename, mode='r'): """ Returns a Python file referring to the given name under the config override volume. """ raise NotImplementedError diff --git a/util/config/provider/fileprovider.py b/util/config/provider/fileprovider.py index 3462eb7e2..099c5c3fd 100644 --- a/util/config/provider/fileprovider.py +++ b/util/config/provider/fileprovider.py @@ -49,8 +49,8 @@ class FileConfigProvider(BaseProvider): def volume_file_exists(self, filename): return os.path.exists(os.path.join(self.config_volume, filename)) - def get_volume_file(self, filename): - return open(os.path.join(self.config_volume, filename)) + def get_volume_file(self, filename, mode='r'): + return open(os.path.join(self.config_volume, filename), mode=mode) def write_volume_file(self, filename, contents): filepath = os.path.join(self.config_volume, filename)