Search for service by type

When you get or create service it first checks to see if an existing
service matching these parameters exists. The definition of existing is
having a service with the same name, however name is not a unique field.
Sahara for example creates two services, one with data-processing, one
with data_processing with the same sahara name.

Search for existing services by service type, not by service name.

Change-Id: I6148e2254aa3968039b0e7c178e7cabc53b6be68
diff --git a/functions-common b/functions-common
index 483b1fa..d6be1ec 100644
--- a/functions-common
+++ b/functions-common
@@ -806,7 +806,7 @@
     # Gets service id
     local service_id=$(
         # Gets service id
-        openstack service show $1 -f value -c id 2>/dev/null ||
+        openstack service show $2 -f value -c id 2>/dev/null ||
         # Creates new service if not exists
         openstack service create \
             $2 \