diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/defaults.py | 3 | ||||
-rw-r--r-- | python/vyos/version.py | 7 |
2 files changed, 9 insertions, 1 deletions
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 |