diff options
author | Dmytro Aleksandrov <alkersan@gmail.com> | 2019-08-30 18:43:44 +0300 |
---|---|---|
committer | Dmytro Aleksandrov <alkersan@gmail.com> | 2019-08-30 18:43:44 +0300 |
commit | 76f498220c796a39a92ce3bed47c1cc5bac1a99d (patch) | |
tree | 09c0119bc7c6850570fd8f8f101a7c8e4cb7248f /src/helpers/vyos-sudo.py | |
parent | 24495a18b2ba39cd0c5b024dbe63f3e7df92e69c (diff) | |
download | vyos-1x-76f498220c796a39a92ce3bed47c1cc5bac1a99d.tar.gz vyos-1x-76f498220c796a39a92ce3bed47c1cc5bac1a99d.zip |
[op-mode] T1621 rewrite misc commands to python/xml syntax
Diffstat (limited to 'src/helpers/vyos-sudo.py')
-rwxr-xr-x | src/helpers/vyos-sudo.py | 9 |
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__': |