Browse code

Simplify add_user_to_group function

Current SLE12 and openSUSE13.X versions can handle usermod's '-a' and '-G'
switches so remove the special case.

Change-Id: If0f1390a0eb8f41ffffca74525a4648cfe8ea61d

Thomas Bechtold authored on 2015/05/31 07:04:33
Showing 1 changed files
... ...
@@ -1842,16 +1842,7 @@ function add_user_to_group {
1842 1842
     local user=$1
1843 1843
     local group=$2
1844 1844
 
1845
-    if [[ -z "$os_VENDOR" ]]; then
1846
-        GetOSVersion
1847
-    fi
1848
-
1849
-    # SLE11 and openSUSE 12.2 don't have the usual usermod
1850
-    if ! is_suse || [[ "$os_VENDOR" = "openSUSE" && "$os_RELEASE" != "12.2" ]]; then
1851
-        sudo usermod -a -G "$group" "$user"
1852
-    else
1853
-        sudo usermod -A "$group" "$user"
1854
-    fi
1845
+    sudo usermod -a -G "$group" "$user"
1855 1846
 }
1856 1847
 
1857 1848
 # Convert CIDR notation to a IPv4 netmask