Skip to content
Snippets Groups Projects
Commit 9c94164b authored by sveseli's avatar sveseli
Browse files

additions to allow local user to access experiment group

parent 45e06939
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,14 @@ class LdapLinuxPlatformUtility:
logger.error('Could not add user %s to group %s: %s' % (username, groupName, ex))
raise InternalError(exception=ex)
@classmethod
def addLocalUserToGroup(cls, username, groupName):
""" Add local user to group. """
logger = cls.getLogger()
logger.debug('Adding local user %s to group %s' % (username, groupName))
cmd = '%s -a -G %s %s' % (cls.USERMOD_CMD, groupName, username)
cls.executeSudoCommand(cmd)
def getGroupInfo(self, groupName):
""" Get given group info. """
logger = self.getLogger()
......
......@@ -46,6 +46,11 @@ class LinuxUtility:
cmd = '%s -a -G %s %s' % (cls.USERMOD_CMD, groupName, username)
cls.executeSudoCommand(cmd)
@classmethod
def addLocalUserToGroup(cls, username, groupName):
""" Add local user to group. """
cls.addUserToGroup(username, groupName)
@classmethod
def setGroupUsers(cls, groupName, usernameList):
""" Set list of users for a given group. """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment