summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-01 21:10:45 +0200
committerGitHub <noreply@github.com>2019-09-01 21:10:45 +0200
commitb25d8e9787ee5243feb6b08098bbba958fe22d8c (patch)
treecf0821334cd982e6c025ff820edcbcb363871713 /src/helpers
parent308886a3fc28aa7772c14452185fb06531ba9dfd (diff)
parent76f498220c796a39a92ce3bed47c1cc5bac1a99d (diff)
downloadvyos-1x-b25d8e9787ee5243feb6b08098bbba958fe22d8c.tar.gz
vyos-1x-b25d8e9787ee5243feb6b08098bbba958fe22d8c.zip
Merge pull request #119 from alkersan/T1621_misc_rewrites
[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__':