diff options
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/defaults.py | 2 | ||||
-rw-r--r-- | python/vyos/util.py | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/python/vyos/defaults.py b/python/vyos/defaults.py index ac831c176..36185f16a 100644 --- a/python/vyos/defaults.py +++ b/python/vyos/defaults.py @@ -17,3 +17,5 @@ directories = { "data": "/usr/share/vyos/" } + +cfg_group = 'vyattacfg' diff --git a/python/vyos/util.py b/python/vyos/util.py index 3c454ed4a..1419e490b 100644 --- a/python/vyos/util.py +++ b/python/vyos/util.py @@ -14,8 +14,12 @@ # License along with this library. If not, see <http://www.gnu.org/licenses/>. import re +import grp import psutil +import vyos.defaults + + def read_file(path): """ Read a file to string """ with open(path, 'r') as f: @@ -114,3 +118,7 @@ def seconds_to_human(s, separator=""): result = "{0}{1}{2}s".format(result, separator, seconds) return result + +def get_cfg_group_id(): + group_data = grp.getgrnam(vyos.defaults.cfg_group) + return group_data.gr_gid |