Yaniv Bronhaim has uploaded a new change for review.

Change subject: db: host-deploy: Adding to vds_static table vars to persist ssh 
authentication fields
......................................................................

db: host-deploy: Adding to vds_static table vars to persist ssh authentication 
fields

This patch adds ssh_username and ssh_port to vds_static

Change-Id: I5aa1a2feb6cd37e3b0d95c39323828aa8a33c54e
Signed-off-by: Yaniv Bronhaim <[email protected]>
---
M backend/manager/modules/dal/src/test/resources/fixtures.xml
M packaging/dbscripts/create_views.sql
A packaging/dbscripts/upgrade/03_03_0400_add_vds_ssh_fields.sql
M 
packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
M packaging/dbscripts/vds_sp.sql
5 files changed, 41 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/16683/1

diff --git a/backend/manager/modules/dal/src/test/resources/fixtures.xml 
b/backend/manager/modules/dal/src/test/resources/fixtures.xml
index bb3d1f3..bdcbe1c 100644
--- a/backend/manager/modules/dal/src/test/resources/fixtures.xml
+++ b/backend/manager/modules/dal/src/test/resources/fixtures.xml
@@ -945,6 +945,8 @@
         <column>_update_date</column>
         <column>vds_spm_priority</column>
         <column>sshKeyFingerprint</column>
+        <column>ssh_port</column>
+        <column>ssh_username</column>
         <row>
             <value>afce7a39-8e8c-4819-ba9c-796d316592e6</value>
             <value>magenta-vdsc</value>
@@ -974,6 +976,8 @@
             <value>2010-12-01 09:52:57</value>
             <value>8</value>
             <value>b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31</value>
+            <value>22</value>
+            <value>root</value>
         </row>
         <row>
             <value>afce7a39-8e8c-4819-ba9c-796d316592e7</value>
@@ -1004,6 +1008,8 @@
             <value>2010-12-01 09:52:57</value>
             <value>6</value>
             <value>b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31</value>
+            <value>22</value>
+            <value>root</value>
         </row>
         <row>
             <value>afce7a39-8e8c-4819-ba9c-796d316592e8</value>
@@ -1034,6 +1040,8 @@
             <value>2010-12-01 09:52:57</value>
             <value>8</value>
             <value>b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31</value>
+            <value>22</value>
+            <value>root</value>
         </row>
         <row>
             <value>23f6d691-5dfb-472b-86dc-9e1d2d3c18f3</value>
@@ -1064,6 +1072,8 @@
             <value>2010-12-01 09:52:57</value>
             <value>4</value>
             <value>b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31</value>
+            <value>22</value>
+            <value>root</value>
         </row>
         <row>
             <value>2001751e-549b-4e7a-aff6-32d36856c125</value>
@@ -1094,6 +1104,8 @@
             <value>2010-12-01 09:52:57</value>
             <value>4</value>
             <value>b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31</value>
+            <value>22</value>
+            <value>root</value>
         </row>
     </table>
 
@@ -5230,6 +5242,14 @@
                <value>vds</value>
                <value>sshkeyfingerprint</value>
                </row>
+        <row>
+        <value>vds</value>
+        <value>ssh_username</value>
+        </row>
+        <row>
+        <value>vds</value>
+        <value>ssh_port</value>
+        </row>
 </table>
 
        <table name="gluster_services">
diff --git a/packaging/dbscripts/create_views.sql 
b/packaging/dbscripts/create_views.sql
index e56c362..6965ed8 100644
--- a/packaging/dbscripts/create_views.sql
+++ b/packaging/dbscripts/create_views.sql
@@ -663,7 +663,7 @@
                       vds_dynamic.transparent_hugepages_state as 
transparent_hugepages_state, vds_dynamic.anonymous_hugepages as 
anonymous_hugepages, vds_dynamic.non_operational_reason as 
non_operational_reason,
                        vds_static.recoverable as recoverable, 
vds_static.sshKeyFingerprint as sshKeyFingerprint, vds_dynamic.hw_manufacturer 
as hw_manufacturer, vds_dynamic.hw_product_name as hw_product_name, 
vds_dynamic.hw_version as hw_version,
                       vds_dynamic.hw_serial_number as hw_serial_number, 
vds_dynamic.hw_uuid as hw_uuid, vds_dynamic.hw_family as hw_family, 
vds_static.console_address as console_address,
-                      vds_dynamic.hbas as hbas, 
vds_dynamic.supported_emulated_machines as supported_emulated_machines
+                      vds_dynamic.hbas as hbas, 
vds_dynamic.supported_emulated_machines as supported_emulated_machines, 
vds_static.ssh_port as ssh_port, vds_static.ssh_username as ssh_username
 FROM         vds_groups INNER JOIN
 vds_static ON vds_groups.vds_group_id = vds_static.vds_group_id INNER JOIN
 vds_dynamic ON vds_static.vds_id = vds_dynamic.vds_id INNER JOIN
@@ -705,7 +705,7 @@
                       vds_groups.compatibility_version AS 
vds_group_compatibility_version, vds_dynamic.host_os, vds_dynamic.kvm_version, 
vds_dynamic.libvirt_version,
                       vds_dynamic.spice_version, vds_dynamic.kernel_version, 
vds_dynamic.iscsi_initiator_name,
                       vds_dynamic.transparent_hugepages_state, 
vds_dynamic.anonymous_hugepages, vds_dynamic.non_operational_reason,
-                      storage_pool_iso_map.storage_id
+                      storage_pool_iso_map.storage_id, vds_static.ssh_port, 
vds_static.ssh_username
 FROM         vds_groups INNER JOIN
 vds_static ON vds_groups.vds_group_id = vds_static.vds_group_id INNER JOIN
 vds_dynamic ON vds_static.vds_id = vds_dynamic.vds_id INNER JOIN
diff --git a/packaging/dbscripts/upgrade/03_03_0400_add_vds_ssh_fields.sql 
b/packaging/dbscripts/upgrade/03_03_0400_add_vds_ssh_fields.sql
new file mode 100644
index 0000000..f5f6ee3
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_03_0400_add_vds_ssh_fields.sql
@@ -0,0 +1,2 @@
+select fn_db_add_column('vds_static', 'ssh_username', 'VARCHAR(255)');
+select fn_db_add_column('vds_static', 'ssh_port', 'INTEGER');
diff --git 
a/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
 
b/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
index 9232e72..90a3275 100644
--- 
a/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
+++ 
b/packaging/dbscripts/upgrade/post_upgrade/0010_add_object_column_white_list_table.sql
@@ -56,7 +56,7 @@
           'vds_group_compatibility_version', 'vds_group_virt_service', 
'vds_group_gluster_service', 'host_os', 'kvm_version', 'libvirt_version', 
'spice_version', 'kernel_version',
           'iscsi_initiator_name', 'transparent_hugepages_state', 
'anonymous_hugepages',
           'non_operational_reason', 'recoverable', 'sshKeyFingerprint', 
'count_threads_as_cores', 'cpu_threads',
-          'hw_manufacturer', 'hw_product_name', 'hw_version', 
'hw_serial_number', 'hw_uuid', 'hw_family'));
+          'hw_manufacturer', 'hw_product_name', 'hw_version', 
'hw_serial_number', 'hw_uuid', 'hw_family', 'ssh_port', 'ssh_username'));
 -- pm_options are missing
 END; $function$
 LANGUAGE plpgsql;
diff --git a/packaging/dbscripts/vds_sp.sql b/packaging/dbscripts/vds_sp.sql
index 8b31e34..1002b58 100644
--- a/packaging/dbscripts/vds_sp.sql
+++ b/packaging/dbscripts/vds_sp.sql
@@ -366,7 +366,9 @@
     v_pm_secondary_concurrent BOOLEAN,
     v_vds_spm_priority INTEGER,
     v_sshKeyFingerprint VARCHAR(128),
-    v_console_address VARCHAR(255))
+    v_console_address VARCHAR(255),
+    v_ssh_port INTEGER,
+    v_ssh_username VARCHAR(255))
 RETURNS VOID
 
    AS $procedure$
@@ -377,12 +379,12 @@
                                
vds_type,vds_strength,pm_type,pm_user,pm_password,pm_port,pm_options,pm_enabled,
                                pm_proxy_preferences, pm_secondary_ip, 
pm_secondary_type, pm_secondary_user,
                                pm_secondary_password, pm_secondary_port, 
pm_secondary_options, pm_secondary_concurrent,
-                               vds_spm_priority, sshKeyFingerprint, 
console_address)
+                               vds_spm_priority, sshKeyFingerprint, 
console_address, ssh_port, ssh_username)
                        VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, 
v_port, v_vds_group_id, v_vds_name, v_server_SSL_enabled,
                                
v_vds_type,v_vds_strength,v_pm_type,v_pm_user,v_pm_password,v_pm_port,v_pm_options,v_pm_enabled,
                                v_pm_proxy_preferences, v_pm_secondary_ip, 
v_pm_secondary_type, v_pm_secondary_user,
                                v_pm_secondary_password, v_pm_secondary_port, 
v_pm_secondary_options, v_pm_secondary_concurrent,
-                               v_vds_spm_priority, v_sshKeyFingerprint, 
v_console_address);
+                               v_vds_spm_priority, v_sshKeyFingerprint, 
v_console_address, v_ssh_port, v_ssh_username);
       END;
    end if;
    RETURN;
@@ -420,7 +422,9 @@
     v_otp_validity BIGINT,
     v_vds_spm_priority INTEGER,
     v_sshKeyFingerprint VARCHAR(128),
-    v_console_address VARCHAR(255))
+    v_console_address VARCHAR(255),
+    v_ssh_port INTEGER,
+    v_ssh_username VARCHAR(255))
 RETURNS VOID
 
        --The [vds_static] table doesn't have a timestamp column. Optimistic 
concurrency logic cannot be generated
@@ -430,7 +434,7 @@
    BEGIN
       UPDATE vds_static
       SET host_name = v_host_name,ip = v_ip,vds_unique_id = v_vds_unique_id,
-      port = v_port,vds_group_id = v_vds_group_id,vds_name = 
v_vds_name,server_SSL_enabled = v_server_SSL_enabled,
+      port = v_port, vds_group_id = v_vds_group_id,vds_name = 
v_vds_name,server_SSL_enabled = v_server_SSL_enabled,
       vds_type = v_vds_type,
       _update_date = LOCALTIMESTAMP,vds_strength = v_vds_strength,
       pm_type = v_pm_type,pm_user = v_pm_user,pm_password = v_pm_password,
@@ -440,7 +444,7 @@
       pm_secondary_port = v_pm_secondary_port, pm_secondary_options = 
v_pm_secondary_options,
       pm_secondary_concurrent = v_pm_secondary_concurrent,
       otp_validity = v_otp_validity, vds_spm_priority = v_vds_spm_priority, 
sshKeyFingerprint = v_sshKeyFingerprint,
-      console_address = v_console_address
+      console_address = v_console_address, ssh_port = v_ssh_port, ssh_username 
= v_ssh_username
       WHERE vds_id = v_vds_id;
    END;
 
@@ -699,22 +703,24 @@
     v_pm_secondary_options VARCHAR(4000),
     v_pm_secondary_concurrent BOOLEAN,
     v_vds_spm_priority INTEGER,
-    v_console_address VARCHAR(255))
+    v_console_address VARCHAR(255),
+    v_ssh_port INTEGER,
+    v_ssh_username VARCHAR(255))
 RETURNS VOID
    AS $procedure$
 BEGIN
 
    BEGIN
-      INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
vds_group_id, vds_name, server_SSL_enabled,
+      INSERT INTO vds_static(vds_id,host_name, ip, vds_unique_id, port, 
ds_group_id, vds_name, server_SSL_enabled,
                              
vds_type,vds_strength,pm_type,pm_user,pm_password, pm_port, pm_options, 
pm_enabled,
                              pm_secondary_ip, pm_secondary_type, 
pm_secondary_user,
                              pm_secondary_password, pm_secondary_port, 
pm_secondary_options, pm_secondary_concurrent,
-                             pm_proxy_preferences, vds_spm_priority, 
console_address)
+                             pm_proxy_preferences, vds_spm_priority, 
console_address, ssh_port, ssh_username)
        VALUES(v_vds_id,v_host_name, v_ip, v_vds_unique_id, v_port, 
v_vds_group_id, v_vds_name, v_server_SSL_enabled,
                v_vds_type, 
v_vds_strength,v_pm_type,v_pm_user,v_pm_password,v_pm_port, v_pm_options, 
v_pm_enabled,
                pm_secondary_ip, pm_secondary_type, pm_secondary_user,
                pm_secondary_password, pm_secondary_port, pm_secondary_options, 
pm_secondary_concurrent,v_pm_proxy_preferences,
-               v_vds_spm_priority, v_console_address);
+               v_vds_spm_priority, v_console_address, v_ssh_port, 
v_ssh_username);
 
       INSERT INTO vds_dynamic(vds_id, status) VALUES(v_vds_id, 0);
 


-- 
To view, visit http://gerrit.ovirt.org/16683
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5aa1a2feb6cd37e3b0d95c39323828aa8a33c54e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to