Commit 35799cc8 by Bach Dániel

random fixes

parent e1bb82f6
...@@ -228,7 +228,7 @@ class Context(BaseContext): ...@@ -228,7 +228,7 @@ class Context(BaseContext):
@staticmethod @staticmethod
def update(filename, executable, checksum, uuid): def update(filename, executable, checksum, uuid):
new_dir = working_directory + '.new' new_dir = working_directory + '.new'
old_dir = working_directory + '.old' old_dir = working_directory + '.old.%s' % uuid
with open(filename, "r") as f: with open(filename, "r") as f:
data = f.read() data = f.read()
local_checksum = md5(data).hexdigest() local_checksum = md5(data).hexdigest()
......
...@@ -2,6 +2,7 @@ import netifaces ...@@ -2,6 +2,7 @@ import netifaces
from netaddr import IPNetwork from netaddr import IPNetwork
import fileinput import fileinput
import logging import logging
import subprocess
logger = logging.getLogger() logger = logging.getLogger()
...@@ -35,9 +36,13 @@ def remove_interfaces_ubuntu(devices): ...@@ -35,9 +36,13 @@ def remove_interfaces_ubuntu(devices):
continue continue
if words[0] == 'iface': if words[0] == 'iface':
if words[1].split(':')[0] in devices: ifname = words[1].split(':')[0]
if ifname in devices:
# remove line # remove line
delete_device = True delete_device = True
subprocess.call(('/sbin/ip', 'addr', 'flush', 'dev', ifname))
subprocess.call(('/sbin/ip', 'link', 'set', 'dev', ifname,
'down'))
continue continue
else: else:
delete_device = False 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