mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 20:12:20 +03:00
ahenk static network bug fixed
This commit is contained in:
parent
e6cf0015ae
commit
3067caf015
2 changed files with 10 additions and 10 deletions
|
@ -44,10 +44,10 @@ class AddNetwork(AbstractPlugin):
|
||||||
|
|
||||||
self.logger.debug('Created content for STATIC type.')
|
self.logger.debug('Created content for STATIC type.')
|
||||||
elif self.type == 'DHCP':
|
elif self.type == 'DHCP':
|
||||||
self.content = 'iface {} inet dhcp\n'.format(self.name)
|
self.content = 'auto {0}\niface {0} inet dhcp\n'.format(self.name)
|
||||||
self.logger.debug('Created content for DHCP type.')
|
self.logger.debug('Created content for DHCP type.')
|
||||||
elif self.type == 'LOOPBACK':
|
elif self.type == 'LOOPBACK':
|
||||||
self.content = 'iface {} inet loopback\n'.format(self.name)
|
self.content = 'auto {0}\niface {0} inet loopback\n'.format(self.name)
|
||||||
self.logger.debug('Created content for LOOPBACK type.')
|
self.logger.debug('Created content for LOOPBACK type.')
|
||||||
|
|
||||||
if self.is_active is False:
|
if self.is_active is False:
|
||||||
|
|
|
@ -42,29 +42,29 @@ class DeleteNetwork(AbstractPlugin):
|
||||||
if not counter:
|
if not counter:
|
||||||
if self.type == 'static':
|
if self.type == 'static':
|
||||||
if self.is_active is True:
|
if self.is_active is True:
|
||||||
self.content = 'iface {0} inet static\n'.format(self.name)
|
self.content = 'auto {0}\n'.format(self.name)
|
||||||
else:
|
else:
|
||||||
self.content = '#iface {0} inet static\n'.format(self.name)
|
self.content = '#auto {0}\n'.format(self.name)
|
||||||
|
|
||||||
if line.startswith(self.content):
|
if line.startswith(self.content):
|
||||||
counter = 3
|
counter = 4
|
||||||
else:
|
else:
|
||||||
print(str(line).strip())
|
print(str(line).strip())
|
||||||
|
|
||||||
elif self.type == 'dhcp':
|
elif self.type == 'dhcp':
|
||||||
if self.is_active is True:
|
if self.is_active is True:
|
||||||
self.content = 'iface {} inet dhcp\n'.format(self.name)
|
self.content = 'auto {0}\n'.format(self.name)
|
||||||
else:
|
else:
|
||||||
self.content = '#iface {} inet dhcp\n'.format(self.name)
|
self.content = '#auto {0}\n'.format(self.name)
|
||||||
|
|
||||||
if not line.startswith(self.content):
|
if not line.startswith(self.content):
|
||||||
print(str(line).strip())
|
print(str(line).strip())
|
||||||
|
|
||||||
elif self.type == 'loopback':
|
elif self.type == 'loopback':
|
||||||
if self.is_active is True:
|
if self.is_active is True:
|
||||||
self.content = 'iface {} inet loopback\n'.format(self.name)
|
self.content = 'auto {0}\n'.format(self.name)
|
||||||
else:
|
else:
|
||||||
self.content = '#iface {} inet loopback\n'.format(self.name)
|
self.content = '#auto {0}\n'.format(self.name)
|
||||||
|
|
||||||
if not line.startswith(self.content):
|
if not line.startswith(self.content):
|
||||||
print(str(line).strip())
|
print(str(line).strip())
|
||||||
|
|
Loading…
Reference in a new issue