Minor cleanup in network module

This commit is contained in:
Anders Ingemann 2014-02-19 22:14:17 +01:00
parent f9ebd247e8
commit cb011dabf3

View file

@ -1,6 +1,6 @@
from base import Task from base import Task
from common import phases from common import phases
import os.path import os
class RemoveDNSInfo(Task): class RemoveDNSInfo(Task):
@ -9,10 +9,8 @@ class RemoveDNSInfo(Task):
@classmethod @classmethod
def run(cls, info): def run(cls, info):
from os import remove
import os.path
if os.path.isfile(os.path.join(info.root, 'etc/resolv.conf')): if os.path.isfile(os.path.join(info.root, 'etc/resolv.conf')):
remove(os.path.join(info.root, 'etc/resolv.conf')) os.remove(os.path.join(info.root, 'etc/resolv.conf'))
class RemoveHostname(Task): class RemoveHostname(Task):
@ -21,10 +19,8 @@ class RemoveHostname(Task):
@classmethod @classmethod
def run(cls, info): def run(cls, info):
from os import remove
import os.path
if os.path.isfile(os.path.join(info.root, 'etc/hostname')): if os.path.isfile(os.path.join(info.root, 'etc/hostname')):
remove(os.path.join(info.root, 'etc/hostname')) os.remove(os.path.join(info.root, 'etc/hostname'))
class ConfigureNetworkIF(Task): class ConfigureNetworkIF(Task):