Users in service group should not have email addresses

Change-Id: Ieed9dffce5cf1e735e482dd3494ac1e103b50955
Closes-Bug: 1185201
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
diff --git a/functions-common b/functions-common
index 9093952..4b660de 100644
--- a/functions-common
+++ b/functions-common
@@ -723,8 +723,13 @@
 }
 
 # Gets or creates user
-# Usage: get_or_create_user <username> <password> <project> <email>
+# Usage: get_or_create_user <username> <password> <project> [<email>]
 function get_or_create_user {
+    if [[ ! -z "$4" ]]; then
+        local EMAIL="--email=$4"
+    else
+        local EMAIL=""
+    fi
     # Gets user id
     USER_ID=$(
         # Gets user id
@@ -734,7 +739,7 @@
             $1 \
             --password "$2" \
             --project $3 \
-            --email $4 \
+            $EMAIL \
             -f value -c id
     )
     echo $USER_ID