On 06/28/2011 12:04 PM, Adam Young wrote:
On 06/28/2011 12:03 PM, Adam Young wrote:



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

https://fedorahosted.org/freeipa/ticket/945


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

From fa9d423ed0a4a5acddc6fdb1adbf21ba475c23c7 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
 https://fedorahosted.org/freeipa/ticket/945

now matches record at the end of the string
---
 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..c2c0b09c79ef6bc8179306ea56a4a0b058c1b106 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