Patch 227 is the automount patch that I still am not ready to submit. This patch stands alone.


From 248323e1ce81b67598067baebc1918c3a15f20e7 Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Mon, 23 May 2011 10:39:09 -0400
Subject: [PATCH] create entities on demand.

---
 install/ui/ipa.js   |   27 ++++++++++++---------------
 install/ui/webui.js |    2 --
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 8f11b92df2e86adc61758da1790e900e562f2510..2e1a9ba5eb972bd8d0eaa3044983001b31065d40 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -131,21 +131,8 @@ var IPA = ( function () {
     };
 
     that.get_entity = function(name) {
-        return that.entities.get(name);
-    };
-
-    that.add_entity = function(entity) {
-        that.entities.put(entity.name, entity);
-    };
-
-    that.remove_entity = function(name) {
-        that.entities.remove(name);
-    };
-
-    that.start_entities = function() {
-        var factory;
-        var name;
-        for (name in that.entity_factories) {
+        if (!that.entities.get(name)){
+            var factory = that.entity_factories[name];
             factory = that.entity_factories[name];
             try {
                 var entity = factory();
@@ -154,8 +141,18 @@ var IPA = ( function () {
             } catch (e) {
                 /*exceptions thrown by builder just mean that entities
                   are not to be registered. */
+                return null;
             }
         }
+        return that.entities.get(name);
+    };
+
+    that.add_entity = function(entity) {
+        that.entities.put(entity.name, entity);
+    };
+
+    that.remove_entity = function(name) {
+        that.entities.remove(name);
     };
 
     that.test_dirty = function(){
diff --git a/install/ui/webui.js b/install/ui/webui.js
index 0e301cafb3f549f8c150cfe880695288d7f24b69..ce2cf2dfe49bc760c53a62fffe2a232215d1e10c 100644
--- a/install/ui/webui.js
+++ b/install/ui/webui.js
@@ -147,8 +147,6 @@ $(function() {
         $('#loggedinas a').fragment(
             {'user-facet': 'details', 'user-pkey': IPA.whoami_pkey}, 2);
 
-        IPA.start_entities();
-
         IPA.nav = create_navigation();
         IPA.nav.create();
         IPA.nav.update();
-- 
1.7.5.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to