summaryrefslogtreecommitdiffstats
path: root/install/ui/ipa.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-11-07 14:21:45 -0600
committerPetr Vobornik <pvoborni@redhat.com>2011-12-21 14:59:49 +0100
commit5fc064f13e44812042a617a322bcd6111d2b39b2 (patch)
treef89503069c5d4eabbb940aff34b9733607ce93d2 /install/ui/ipa.js
parent49e5555b11d0bee814bce807acacbfeb381379f1 (diff)
downloadfreeipa-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.gz
freeipa-5fc064f13e44812042a617a322bcd6111d2b39b2.tar.xz
freeipa-5fc064f13e44812042a617a322bcd6111d2b39b2.zip
Refactored entity object resolution.
The IPA.get_entity() has been modified to accept either entity name or entity object. If it receives an entity object it will return the object itself. Otherwise, it will resolve the name in the entity registry. The other_entity variables have been modified to store a reference to the entity object instead of its name. The test cases have been modified to use real entity objects instead of just the names. Ticket #2042
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r--install/ui/ipa.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index b39a4e566..5d59a89a4 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -187,12 +187,11 @@ var IPA = function() {
if (!factory) return null;
try {
- var builder = that.entity_builder();
+ var builder = IPA.entity_builder();
builder.entity({
factory: factory,
- name: name,
- builder: builder
+ name: name
});
var entity = builder.build();
@@ -222,6 +221,7 @@ var IPA = function() {
};
that.get_entity = function(name) {
+ if (typeof name === 'object') return name;
var entity = that.entities.get(name);
if (!entity) {
entity = that.create_entity(name);