[node-patches] Change in ovirt-node[master]: Populate RHN page username field

rbarry at redhat.com rbarry at redhat.com
Mon Jul 21 14:09:57 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Populate RHN page username field
......................................................................

Populate RHN page username field

If a username has previously been entered, use that instead of a
blank entry box.

Change-Id: I412137101cb7dfc10d8b3491719827e67c715592
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1098580
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/rhn/rhn_page.py
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/41/30541/1

diff --git a/src/ovirt/node/setup/rhn/rhn_page.py b/src/ovirt/node/setup/rhn/rhn_page.py
index f3c920d..3ce0683 100644
--- a/src/ovirt/node/setup/rhn/rhn_page.py
+++ b/src/ovirt/node/setup/rhn/rhn_page.py
@@ -123,7 +123,7 @@
     def model(self):
         cfg = rhn_model.RHN().retrieve()
         self.logger.debug(cfg)
-        model = {"rhn.user": "",
+        model = {"rhn.username": "",
                  "rhn.password": "",
                  "rhn.profilename": "",
                  "rhn.type": "",
@@ -139,6 +139,7 @@
 
         rhn_conf = get_rhn_config()
         status, rhn_type = get_rhn_status()
+        model["rhn.username"] = cfg["username"]
         model["rhn.type"] = rhn_type.lower()
         model["rhn.profilename"] = cfg["profile"]
         if RHN_XMLRPC_ADDR not in rhn_conf["serverURL"] and not sam_check():
@@ -172,7 +173,7 @@
         return model
 
     def validators(self):
-        return {"rhn.user": valid.Text(),
+        return {"rhn.username": valid.Text(),
                 "rhn.profilename": valid.Empty() | valid.Text(min_length=3),
                 "rhn.url": valid.Empty() | valid.URL(),
                 "rhn.ca": valid.Empty() | valid.URL(),
@@ -207,7 +208,7 @@
                           % rhn_type
 
             ws = [ui.Header("header[0]", rhn_msg),
-                  ui.Entry("rhn.user", "Login:"),
+                  ui.Entry("rhn.username", "Login:"),
                   ui.PasswordEntry("rhn.password", "Password:"),
                   ui.Entry("rhn.profilename", "Profile Name (optional):"),
                   ui.Divider("divider[0]"),
@@ -248,7 +249,7 @@
         self.logger.debug("Changes: %s" % changes)
         self.logger.debug("Effective Model: %s" % effective_model)
 
-        rhn_keys = ["rhn.user", "rhn.password", "rhn.profilename", "rhn.type",
+        rhn_keys = ["rhn.username", "rhn.password", "rhn.profilename", "rhn.type",
                     "rhn.url", "rhn.ca", "rhn.proxyhost", "rhn.proxyport",
                     "rhn.proxyuser", "rhn.proxypassword", "rhn.org",
                     "rhn.activation_key"]
@@ -258,7 +259,7 @@
         if changes.contains_any(rhn_keys):
             self.logger.debug(changes)
             self.logger.debug(effective_model)
-            user = effective_model["rhn.user"]
+            user = effective_model["rhn.username"]
             pw = effective_model["rhn.password"]
             profilename = effective_model["rhn.profilename"]
             rhn_type = effective_model["rhn.type"]


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I412137101cb7dfc10d8b3491719827e67c715592
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list