[node-patches] Change in ovirt-node[master]: kdump:Fix not enough arguments given exception

hadong0720 at gmail.com hadong0720 at gmail.com
Mon Feb 17 07:20:47 UTC 2014


hadong has uploaded a new change for review.

Change subject: kdump:Fix not enough arguments given exception
......................................................................

kdump:Fix not enough arguments given exception

Change-Id: Ib93c7c99990a9f622ba2d38345d1ff5adfcdbe03
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/config/defaults.py
M src/ovirt/node/setup/core/kdump_page.py
2 files changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/34/24534/1

diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index 70b95af..8261dfa 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -1018,16 +1018,19 @@
                 }
 
     def configure_nfs(self, nfs_location):
-        self.update(nfs_location, None, None)
+        self.update(nfs_location, None, None, None)
 
     def configure_ssh(self, ssh_location):
-        self.update(None, ssh_location, None)
+        self.update(None, ssh_location, None, None)
+
+    def configure_ssh_key(self, ssh_location, ssh_key):
+        self.update(None, ssh_location, ssh_key, None)
 
     def configure_local(self):
-        self.update(None, None, True)
+        self.update(None, None, None, True)
 
     def disable_kdump(self):
-        self.update(None, None, None)
+        self.update(None, None, None, None)
 
     def retrieve(self):
         cfg = dict(NodeConfigFileSection.retrieve(self))
diff --git a/src/ovirt/node/setup/core/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
index 62e6f2f..55e23de 100644
--- a/src/ovirt/node/setup/core/kdump_page.py
+++ b/src/ovirt/node/setup/core/kdump_page.py
@@ -163,7 +163,10 @@
             if ktype == "nfs":
                 model.configure_nfs(nfsloc)
             elif ktype == "ssh":
-                model.configure_ssh(sshloc)
+                if "kdump.ssh_key" in changes:
+                    model.configure_ssh_key(sshloc, sshkey)
+                else:
+                    model.configure_ssh(sshloc)
             elif ktype == "local":
                 model.configure_local()
             else:
@@ -193,7 +196,11 @@
             if saved_model["kdump.type"] == "nfs":
                 model.configure_nfs(saved_model["kdump.nfs_location"])
             elif saved_model["kdump.type"] == "kdump.ssh_location":
-                model.configure_ssh(saved_model['kdump.ssh_location'])
+                if self.model()["kdump.ssh_key"] is not "":
+                    model.configure_ssh_key(saved_model['kdump.ssh_location'],
+                                            saved_model['kdump.ssh_key'])
+                else:
+                    model.configure_ssh(saved_model['kdump.ssh_location'])
             elif saved_model["kdump.type"] == "local":
                 model.configure_local()
             else:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib93c7c99990a9f622ba2d38345d1ff5adfcdbe03
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list