From 7023d87e05b076953efc2d0b970ca24c0f0bb11e Mon Sep 17 00:00:00 2001 From: Sebastien Couture Date: Wed, 18 Nov 2015 18:15:59 -0500 Subject: [PATCH 1/2] Added support for DNS SRV records --- network/dnsmadeeasy.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/network/dnsmadeeasy.py b/network/dnsmadeeasy.py index cce7bd10082..090e1f6f342 100644 --- a/network/dnsmadeeasy.py +++ b/network/dnsmadeeasy.py @@ -210,10 +210,12 @@ class DME2: if result['name'] == record_name and result['type'] == record_type: return result return False - elif record_type in ["MX", "NS", "TXT"]: + elif record_type in ["MX", "NS", "TXT", "SRV"]: for result in self.all_records: if record_type == "MX": value = record_value.split(" ")[1] + elif record_type == "SRV": + value = record_value.split(" ")[3] else: value = record_value if result['name'] == record_name and result['type'] == record_type and result['value'] == value: @@ -309,6 +311,13 @@ def main(): new_record["mxLevel"] = new_record["value"].split(" ")[0] new_record["value"] = new_record["value"].split(" ")[1] + # Special handling for SRV records + if new_record["type"] == "SRV": + new_record["priority"] = new_record["value"].split(" ")[0] + new_record["weight"] = new_record["value"].split(" ")[1] + new_record["port"] = new_record["value"].split(" ")[2] + new_record["value"] = new_record["value"].split(" ")[3] + # Compare new record against existing one changed = False if current_record: From 7546cab1e54407a7027adb576a15970bcdd3c390 Mon Sep 17 00:00:00 2001 From: Sebastien Couture Date: Tue, 12 Jan 2016 09:43:10 -0500 Subject: [PATCH 2/2] removed comment --- network/dnsmadeeasy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/network/dnsmadeeasy.py b/network/dnsmadeeasy.py index 090e1f6f342..db819b67662 100644 --- a/network/dnsmadeeasy.py +++ b/network/dnsmadeeasy.py @@ -204,7 +204,6 @@ class DME2: if not self.all_records: self.all_records = self.getRecords() - # TODO SRV type not yet implemented if record_type in ["A", "AAAA", "CNAME", "HTTPRED", "PTR"]: for result in self.all_records: if result['name'] == record_name and result['type'] == record_type: