Skip to content

Commit

Permalink
remove txt record with its value
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalekremharmansa committed Nov 15, 2020
1 parent 51de9e4 commit d02e9d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ twine = ${python} -m twine
pip = ${python} -m pip

install-local: build-module
${pip} uninstall windowsdnsserver-py
${pip} uninstall -y windowsdnsserver-py
${pip} install windowsdnsserver-py --no-index --find-links dist/

upload: build-module
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="windowsdnsserver-py",
version="0.0.1",
version="0.0.2.dev1",
author="Bilal Ekrem Harmansa",
author_email="bilalekremharmansa@gmail.com",
description="wrapper Python library for Windows Server DnsServer module",
Expand Down
2 changes: 1 addition & 1 deletion windowsdnsserver/dns/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def remove_a_record(self, zone: str, name: str) -> bool:
def add_txt_record(self, zone: str, name: str, content, ttl: str) -> bool:
raise MethodNotImplementedError()

def remove_txt_record(self, zone: str, name: str) -> bool:
def remove_txt_record(self, zone: str, name: str, record_data: str) -> bool:
raise MethodNotImplementedError()
5 changes: 4 additions & 1 deletion windowsdnsserver/dns/dnsserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def add_txt_record(self, zone: str, name: str, content, ttl: str = '1h') -> bool

return result.success

def remove_txt_record(self, zone: str, name: str) -> bool:
def remove_txt_record(self, zone: str, name: str, record_data: str = None) -> bool:
""" uses Remove-DnsServerResourceRecord cmdlet to remove txt record in a zone """

args = {
Expand All @@ -106,6 +106,9 @@ def remove_txt_record(self, zone: str, name: str) -> bool:
if name:
args['Name'] = name

if record_data:
args['RecordData'] = '"%s"' % record_data

flags = ['Force']

command = PowerShellCommand('Remove-DnsServerResourceRecord', *flags, **args)
Expand Down

0 comments on commit d02e9d6

Please sign in to comment.