From 735e7811e15aa9108f8656063c435fa0529c86fc Mon Sep 17 00:00:00 2001
From: Jedrzej Nowak <pigmej@gmail.com>
Date: Thu, 28 Jan 2016 19:27:07 +0100
Subject: [PATCH] Removed ssh_ prefix in ssh transports

Closes-bug: 1537093
---
 examples/riak/riaks.py                        |  7 ++++---
 examples/solar_agent/example.py               |  4 ++--
 resources/transport_ssh/1.0.0/meta.yaml       |  8 ++++----
 templates/nodes/1.0.0/nodes.yaml              | 14 ++++++-------
 .../1.0.0/not_provisioned_nodes.yaml          | 20 +++++++++----------
 5 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/examples/riak/riaks.py b/examples/riak/riaks.py
index 8202c47..29393b2 100755
--- a/examples/riak/riaks.py
+++ b/examples/riak/riaks.py
@@ -33,6 +33,7 @@ def setup_riak():
     ModelMeta.remove_all()
     resources = cr.create('nodes', 'templates/nodes', {'count': 3})
     nodes = resources.like('node')
+
     hosts_services = resources.like('hosts_file')
     node1, node2, node3 = nodes
 
@@ -217,9 +218,9 @@ def add_solar_agent(i):
     # install solar_agent with ssh
     signals.connect(transports_for_solar_agent, solar_agent_transport, {})
 
-    signals.connect(ssh_transport, transports_for_solar_agent, {'ssh_key': 'transports:key',
-                                                           'ssh_user': 'transports:user',
-                                                           'ssh_port': 'transports:port',
+    signals.connect(ssh_transport, transports_for_solar_agent, {'key': 'transports:key',
+                                                           'user': 'transports:user',
+                                                           'port': 'transports:port',
                                                            'name': 'transports:name'})
 
     # add solar_agent to transports on this node
diff --git a/examples/solar_agent/example.py b/examples/solar_agent/example.py
index 08114b6..8899478 100644
--- a/examples/solar_agent/example.py
+++ b/examples/solar_agent/example.py
@@ -20,8 +20,8 @@ def run():
     transports_for_solar_agent = cr.create('transports_for_solar_agent', 'resources/transports')[0]
 
     ssh_transport  = cr.create('ssh_transport', 'resources/transport_ssh',
-                               {'ssh_key': '/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key',
-                                'ssh_user': 'vagrant'})[0]
+                               {'key': '/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key',
+                                'user': 'vagrant'})[0]
 
     solar_agent_transport  = cr.create('solar_agent_transport', 'resources/transport_solar_agent',
                                   {'solar_agent_user': 'vagrant',
diff --git a/resources/transport_ssh/1.0.0/meta.yaml b/resources/transport_ssh/1.0.0/meta.yaml
index 4273ed8..4218f5f 100644
--- a/resources/transport_ssh/1.0.0/meta.yaml
+++ b/resources/transport_ssh/1.0.0/meta.yaml
@@ -1,14 +1,14 @@
 input:
-  ssh_key:
+  key:
     schema: str
     value:
-  ssh_password:
+  password:
     schema: str
     value:
-  ssh_user:
+  user:
     schema: str!
     value:
-  ssh_port:
+  port:
     schema: int!
     value: 22
   name:
diff --git a/templates/nodes/1.0.0/nodes.yaml b/templates/nodes/1.0.0/nodes.yaml
index d960c13..1a376de 100644
--- a/templates/nodes/1.0.0/nodes.yaml
+++ b/templates/nodes/1.0.0/nodes.yaml
@@ -5,9 +5,9 @@ resources:
   - id: ssh_transport#{j}#
     from: resources/transport_ssh
     input:
-      ssh_user: 'vagrant'
-      ssh_key: '/vagrant/.vagrant/machines/solar-dev#{j}#/virtualbox/private_key'
-      ssh_password: null
+      user: 'vagrant'
+      key: '/vagrant/.vagrant/machines/solar-dev#{j}#/virtualbox/private_key'
+      password: null
   - id: rsync#{j}#
     from: resources/transport_rsync
     input:
@@ -18,11 +18,11 @@ resources:
     from: resources/transports
     input:
       transports:
-        - key: ssh_transport#{j}#::ssh_key
-          user: ssh_transport#{j}#::ssh_user
-          port: ssh_transport#{j}#::ssh_port
+        - key: ssh_transport#{j}#::key
+          user: ssh_transport#{j}#::user
+          port: ssh_transport#{j}#::port
           name: ssh_transport#{j}#::name
-          password: ssh_transport#{j}#::ssh_password
+          password: ssh_transport#{j}#::password
         - key: rsync#{j}#::key
           name: rsync#{j}#::name
           user: rsync#{j}#::user
diff --git a/templates/not_provisioned_nodes/1.0.0/not_provisioned_nodes.yaml b/templates/not_provisioned_nodes/1.0.0/not_provisioned_nodes.yaml
index db86a7e..3c62c9c 100644
--- a/templates/not_provisioned_nodes/1.0.0/not_provisioned_nodes.yaml
+++ b/templates/not_provisioned_nodes/1.0.0/not_provisioned_nodes.yaml
@@ -5,14 +5,14 @@ resources:
   - id: ssh_transport#{ id }#
     from: resources/transport_ssh
     input:
-      ssh_user: 'root'
-      ssh_key: '/vagrant/tmp/keys/ssh_private'
+      user: 'root'
+      key: '/vagrant/tmp/keys/ssh_private'
   - id: transports#{id}#
     from: resources/transports
     input:
-      transports:key: ssh_transport#{id}#::ssh_key
-      transports:user: ssh_transport#{id}#::ssh_user
-      transports:port: ssh_transport#{id}#::ssh_port
+      transports:key: ssh_transport#{id}#::key
+      transports:user: ssh_transport#{id}#::user
+      transports:port: ssh_transport#{id}#::port
       transports:name: ssh_transport#{id}#::name
   - id: node_#{id}#
     from: resources/not_provisioned_node
@@ -26,14 +26,14 @@ resources:
   - id: ssh_transport_master
     from: resources/transport_ssh
     input:
-      ssh_user: 'vagrant'
-      ssh_key: '/vagrant/.vagrant/machines/solar-dev/virtualbox/private_key'
+      user: 'vagrant'
+      key: '/vagrant/.vagrant/machines/solar-dev/virtualbox/private_key'
   - id: transports_master
     from: resources/transports
     input:
-      transports:key: ssh_transport_master::ssh_key
-      transports:user: ssh_transport_master::ssh_user
-      transports:port: ssh_transport_master::ssh_port
+      transports:key: ssh_transport_master::key
+      transports:user: ssh_transport_master::user
+      transports:port: ssh_transport_master::port
       transports:name: ssh_transport_master::name
   - id: node_master
     from: resources/ro_node