def ensure_user_groups(self, username, groups=[]):
        for user_group in groups:
            if not self.user_in_group(username, user_group):
                self.log("User %s should be in group %s! Rectifying that..." % (username, user_group))
                self.execute('usermod -G %s %s' % (user_group, username), stdout=False, sudo=True)
                self.log("User %s is in group %s now!" % (username, user_group))
dataset/ETHPy150Open python-provy/provy/provy/more/debian/users/user.py/UserRole.ensure_user_groups/original