Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3666457b
authored
Oct 31, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix networking code
parent
bf158927
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
linux/network.py
+6
-4
No files found.
linux/network.py
View file @
3666457b
...
...
@@ -40,10 +40,6 @@ def remove_interfaces_ubuntu(devices):
if
ifname
in
devices
:
# remove line
delete_device
=
True
subprocess
.
call
((
'/sbin/ifdown'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'addr'
,
'flush'
,
'dev'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'link'
,
'set'
,
'dev'
,
ifname
,
'down'
))
continue
else
:
delete_device
=
False
...
...
@@ -58,6 +54,12 @@ def remove_interfaces_ubuntu(devices):
def
change_ip_ubuntu
(
interfaces
,
dns
):
data
=
list
(
get_interfaces_linux
(
interfaces
))
for
ifname
,
conf
in
data
:
subprocess
.
call
((
'/sbin/ifdown'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'addr'
,
'flush'
,
'dev'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'link'
,
'set'
,
'dev'
,
ifname
,
'down'
))
remove_interfaces_ubuntu
(
dict
(
data
)
.
keys
())
with
open
(
interfaces_file
,
'a'
)
as
f
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment