Commit 35799cc8 by Bach Dániel

random fixes

parent e1bb82f6
......@@ -228,7 +228,7 @@ class Context(BaseContext):
@staticmethod
def update(filename, executable, checksum, uuid):
new_dir = working_directory + '.new'
old_dir = working_directory + '.old'
old_dir = working_directory + '.old.%s' % uuid
with open(filename, "r") as f:
data = f.read()
local_checksum = md5(data).hexdigest()
......
......@@ -2,6 +2,7 @@ import netifaces
from netaddr import IPNetwork
import fileinput
import logging
import subprocess
logger = logging.getLogger()
......@@ -35,9 +36,13 @@ def remove_interfaces_ubuntu(devices):
continue
if words[0] == 'iface':
if words[1].split(':')[0] in devices:
ifname = words[1].split(':')[0]
if ifname in devices:
# remove line
delete_device = True
subprocess.call(('/sbin/ip', 'addr', 'flush', 'dev', ifname))
subprocess.call(('/sbin/ip', 'link', 'set', 'dev', ifname,
'down'))
continue
else:
delete_device = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment