From e916c9a55ffdff970c1796829d1bee319802b353 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 8 Jun 2018 20:50:12 +0200 Subject: Move the version.json file used by newer code to /usr/share/vyos --- python/vyos/defaults.py | 3 +++ python/vyos/version.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 python/vyos/defaults.py (limited to 'python/vyos') diff --git a/python/vyos/defaults.py b/python/vyos/defaults.py new file mode 100644 index 000000000..43f222cc7 --- /dev/null +++ b/python/vyos/defaults.py @@ -0,0 +1,3 @@ +directories = { + "data": "/usr/share/vyos/" +} diff --git a/python/vyos/version.py b/python/vyos/version.py index 5d32d878d..545d4e76b 100644 --- a/python/vyos/version.py +++ b/python/vyos/version.py @@ -17,9 +17,14 @@ # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR # IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +import os import json -def get_version_data(file='/opt/vyatta/etc/version.json'): +import vyos.defaults + +version_file = os.path.join(vyos.defaults.directories['data'], 'version.json') + +def get_version_data(file=version_file): with open(file, 'r') as f: version_data = json.load(f) return version_data -- cgit v1.2.3