summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py8
1 files changed, 8 insertions, 0 deletions
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