Merge "Fix default compute driver name for newton"
diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml
new file mode 100644
index 0000000..f847543
--- /dev/null
+++ b/.kitchen.travis.yml
@@ -0,0 +1,6 @@
+suites:
+
+  - name: <%= ENV['SUITE'] %>
+    provisioner:
+      pillars-from-files:
+        neutron.sls: tests/pillar/<%= ENV['SUITE'] %>.sls
diff --git a/.kitchen.yml b/.kitchen.yml
index d0d8c0d..500aef2 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -48,7 +48,7 @@
 
 suites:
 
-  - name: compute_cluster_<%= ENV['OS_VERSION'] || 'ocata' %>
+  - name: compute_cluster
     provisioner:
       pillars-from-files:
         nova.sls: tests/pillar/compute_cluster.sls
@@ -58,7 +58,7 @@
             compute:
               version: <%= ENV['OS_VERSION'] || 'ocata' %>
 
-  - name: control_cluster_<%= ENV['OS_VERSION'] || 'ocata' %>
+  - name: control_cluster
     provisioner:
       pillars-from-files:
         nova.sls: tests/pillar/control_cluster.sls
diff --git a/.travis.yml b/.travis.yml
index acf3873..265206b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,17 +17,21 @@
   - bundle install
 
 env:
-  - PLATFORM=trevorj/salty-whales:trusty OS_VERSION=mitaka
-  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=mitaka
-  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=newton
-  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=ocata
+  - PLATFORM=trevorj/salty-whales:trusty OS_VERSION=mitaka SUITE=compute_cluster
+  - PLATFORM=trevorj/salty-whales:trusty OS_VERSION=mitaka SUITE=control_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=mitaka SUITE=compute_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=mitaka SUITE=control_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=newton SUITE=compute_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=newton SUITE=control_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=ocata SUITE=compute_cluster
+  - PLATFORM=trevorj/salty-whales:xenial OS_VERSION=ocata SUITE=control_cluster
 
 before_script:
   - set -o pipefail
   - make test | tail
 
 script:
-  - test ! -e .kitchen.yml || bundle exec kitchen test -t tests/integration
+  -  KITCHEN_LOCAL_YAML=.kitchen.travis.yml bundle exec kitchen test -t tests/integration
 
 notifications:
   webhooks:
diff --git a/_states/novang.py b/_states/novang.py
index 00c74d8..a3376e7 100644
--- a/_states/novang.py
+++ b/_states/novang.py
@@ -252,7 +252,7 @@
             'comment': 'Instance "{0}" was successfuly created'.format(name)}
 
 
-def keypair_present(name, pub_file, profile=None):
+def keypair_present(name, pub_file=None, pub_key=None, profile=None):
     """
     Ensures that the Nova key-pair exists
     """
@@ -262,7 +262,7 @@
         return _already_exists(name, 'Keypair')
     else:
         res = __salt__['novang.keypair_add'](name, pubfile=pub_file,
-                                             profile=profile)
+                                             pubkey=pub_key, profile=profile)
         if res and res['name'] == name:
             return _created(name, 'Keypair', res)
         return _create_failed(name, 'Keypair')
diff --git a/nova/client.sls b/nova/client.sls
index ea4aaa0..87ae2cb 100644
--- a/nova/client.sls
+++ b/nova/client.sls
@@ -39,7 +39,12 @@
 nova_keypair_{{ keypair_name }}:
   novang.keypair_present:
     - name: {{ keypair_name }}
+    {%- if keypair.pub_file is defined %}
     - pub_file: {{ keypair.pub_file }}
+    {%- endif %}
+    {%- if keypair.pub_key is defined %}
+    - pub_key: {{ keypair.pub_key }}
+    {%- endif %}
     - profile: {{ identity_name }}
 {%- endfor %}