From 04411b4bfc4d807b8b0a22ae2912671c3464c144 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Tue, 29 Dec 2015 13:27:17 +0100 Subject: [PATCH] Removed old config ideas Also deprecates current form of provider.py Change-Id: Ic259ab37ec0778643623566535ffe7f6f62af12f --- config.yaml | 20 -------------------- solar/core/provider.py | 7 +++++++ solar/utils.py | 19 ------------------- 3 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 config.yaml diff --git a/config.yaml b/config.yaml deleted file mode 100644 index 298ddaf1..00000000 --- a/config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -clients-data-file: /tmp/connections.yaml - -tmp: /tmp - -examples-dir: /vagrant/examples - -extensions-dir: /vagrant/solar/solar/extensions - -file-system-db: - storage-path: /tmp/storage - -template-dir: /vagrant/templates - -resources-directory: /tmp/git -resources-files-mask: /vagrant/resources/*/*.yaml -resources-compiled-file: /vagrant/resources_compiled.py -node_resource_template: /vagrant/resources/ro_node/ - -state: /tmp/state/ - diff --git a/solar/core/provider.py b/solar/core/provider.py index 89868d87..2c44071d 100644 --- a/solar/core/provider.py +++ b/solar/core/provider.py @@ -12,6 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. + +import warnings + +warnings.warn("For now this file is deprecated " + "in future it will be part of Solar repository logic", + DeprecationWarning) + from fabric import api as fabric_api import os import requests diff --git a/solar/utils.py b/solar/utils.py index 3cc3753d..1825b902 100644 --- a/solar/utils.py +++ b/solar/utils.py @@ -133,25 +133,6 @@ def load_file(fpath): return {} -def read_config(): - CONFIG_FILE = os.environ.get('CONFIG_FILE') or '/vagrant/config.yaml' - return load_file(CONFIG_FILE) - - -def read_config_file(key): - fpath = read_config()[key] - - return load_file(fpath) - - -def save_to_config_file(key, data): - fpath = read_config()[key] - - with open(fpath, 'w') as f: - encoder = ext_encoder(fpath) - encoder.dump(data, f) - - def solar_map(funct, args, **kwargs): return map(funct, args)