summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorDmytro Aleksandrov <alkersan@gmail.com>2019-08-30 18:43:44 +0300
committerDmytro Aleksandrov <alkersan@gmail.com>2019-08-30 18:43:44 +0300
commit76f498220c796a39a92ce3bed47c1cc5bac1a99d (patch)
tree09c0119bc7c6850570fd8f8f101a7c8e4cb7248f /src/helpers
parent24495a18b2ba39cd0c5b024dbe63f3e7df92e69c (diff)
downloadvyos-1x-76f498220c796a39a92ce3bed47c1cc5bac1a99d.tar.gz
vyos-1x-76f498220c796a39a92ce3bed47c1cc5bac1a99d.zip
[op-mode] T1621 rewrite misc commands to python/xml syntax
Diffstat (limited to 'src/helpers')
-rwxr-xr-xsrc/helpers/vyos-sudo.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/helpers/vyos-sudo.py b/src/helpers/vyos-sudo.py
index 0101a0c95..3e4c196d9 100755
--- a/src/helpers/vyos-sudo.py
+++ b/src/helpers/vyos-sudo.py
@@ -15,17 +15,10 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-import getpass
-import grp
import os
import sys
-
-def is_admin() -> bool:
- """Look if current user is in sudo group"""
- current_user = getpass.getuser()
- (_, _, _, admin_group_members) = grp.getgrnam('sudo')
- return current_user in admin_group_members
+from vyos.util import is_admin
if __name__ == '__main__':