From a6bfd3b44612a3b7bc769b9a8d3895578842fe76 Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Tue, 28 Jun 2011 12:02:48 -0400
Subject: [PATCH] Generate record type list from metadata

---
 install/ui/dns.js |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/install/ui/dns.js b/install/ui/dns.js
index c22bdbb809ae5c603b92ab18a4e2a9961ba0b0bb..3d4906b465a97ea2666ea81e78cfb6982dd12c73 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -106,12 +106,22 @@ IPA.dnsrecord_facet = function(spec) {
 
     var that = IPA.search_facet(spec);
 
-    var record_types = [
-        'a', 'aaaa', 'dname', 'cname', 'mx', 'ns', 'ptr',
-        'srv', 'txt', 'a6', 'afsdb', 'cert', 'ds',
-        'key', 'kx', 'loc',  'naptr', 'nsec',
-        'rrsig', 'sshfp'
-    ];
+    function generate_recordtype_list(){
+        var attrs = IPA.metadata.objects.dnsrecord.default_attributes;
+        var record_types = [];
+        for (var i =0; i < attrs.length; i+=1){
+            var attr = attrs[i];
+            var index = attr.search('record');
+            if (index > -1){
+                var rec_type = attr.substring(0,index);
+                record_types.push(rec_type);
+            }
+        }
+        return record_types;
+
+    }
+
+    var record_types =  generate_recordtype_list();
 
     that.init = function() {
 
-- 
1.7.5.2

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

Reply via email to