mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-21 22:02:15 +03:00
dns and network plugins fixed
This commit is contained in:
parent
6963448efe
commit
a8e33f640c
4 changed files with 7 additions and 7 deletions
|
@ -23,10 +23,10 @@ class AddDNS(AbstractPlugin):
|
|||
def handle_task(self):
|
||||
try:
|
||||
if self.is_active is True:
|
||||
content = 'nameserver {}\n'.format(self.ip)
|
||||
content = '\nnameserver {}\n'.format(self.ip)
|
||||
self.logger.debug('Created active dns content.')
|
||||
else:
|
||||
content = '#nameserver {}\n'.format(self.ip)
|
||||
content = '\n#nameserver {}\n'.format(self.ip)
|
||||
self.logger.debug('Created passive dns content.')
|
||||
|
||||
self.logger.debug('Writing to file...')
|
||||
|
|
|
@ -21,7 +21,7 @@ class AddDomain(AbstractPlugin):
|
|||
|
||||
def handle_task(self):
|
||||
try:
|
||||
content = 'domain {0}\nsearch {0}\n'.format(self.domain)
|
||||
content = '\ndomain {0}\nsearch {0}\n'.format(self.domain)
|
||||
|
||||
self.logger.debug('Writing to file...')
|
||||
self.write_file(self.dns_file, content, 'a')
|
||||
|
|
|
@ -24,10 +24,10 @@ class AddHost(AbstractPlugin):
|
|||
def handle_task(self):
|
||||
try:
|
||||
if self.is_active is True:
|
||||
content = '{0} {1}\n'.format(self.ip, self.hostname)
|
||||
content = '\n{0} {1}\n'.format(self.ip, self.hostname)
|
||||
self.logger.debug('Created active host content.')
|
||||
else:
|
||||
content = '#{0} {1}\n'.format(self.ip, self.hostname)
|
||||
content = '\n#{0} {1}\n'.format(self.ip, self.hostname)
|
||||
self.logger.debug('Created passive host content.')
|
||||
|
||||
self.logger.debug('Writing to file...')
|
||||
|
|
|
@ -32,12 +32,12 @@ class AddNetwork(AbstractPlugin):
|
|||
try:
|
||||
if self.type == 'STATIC':
|
||||
if self.is_active is True:
|
||||
self.content = 'auto {0}\niface {0} inet static\naddress {1}\nnetmask {2}\ngateway {3}\n'.format(self.name,
|
||||
self.content = '\nauto {0}\niface {0} inet static\naddress {1}\nnetmask {2}\ngateway {3}\n'.format(self.name,
|
||||
self.ip,
|
||||
self.netmask,
|
||||
self.gateway)
|
||||
else:
|
||||
self.content = 'auto {0}\niface {0} inet static\n#address {1}\n#netmask {2}\n#gateway {3}\n'.format(self.name,
|
||||
self.content = '\nauto {0}\niface {0} inet static\n#address {1}\n#netmask {2}\n#gateway {3}\n'.format(self.name,
|
||||
self.ip,
|
||||
self.netmask,
|
||||
self.gateway)
|
||||
|
|
Loading…
Reference in a new issue