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
951f3833
authored
Oct 25, 2014
by
IK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing ifdown line
parent
35799cc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
linux/network.py
+3
-0
No files found.
linux/network.py
View file @
951f3833
...
@@ -40,6 +40,7 @@ def remove_interfaces_ubuntu(devices):
...
@@ -40,6 +40,7 @@ def remove_interfaces_ubuntu(devices):
if
ifname
in
devices
:
if
ifname
in
devices
:
# remove line
# remove line
delete_device
=
True
delete_device
=
True
subprocess
.
call
((
'/sbin/ifdown'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'addr'
,
'flush'
,
'dev'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'addr'
,
'flush'
,
'dev'
,
ifname
))
subprocess
.
call
((
'/sbin/ip'
,
'link'
,
'set'
,
'dev'
,
ifname
,
subprocess
.
call
((
'/sbin/ip'
,
'link'
,
'set'
,
'dev'
,
ifname
,
'down'
))
'down'
))
...
@@ -89,6 +90,8 @@ def change_ip_ubuntu(interfaces, dns):
...
@@ -89,6 +90,8 @@ def change_ip_ubuntu(interfaces, dns):
'prefixlen'
:
prefixlen
,
'prefixlen'
:
prefixlen
,
'gw'
:
conf
[
'gw6'
if
ip
.
version
==
6
else
'gw4'
],
'gw'
:
conf
[
'gw6'
if
ip
.
version
==
6
else
'gw4'
],
'dns'
:
dns
})
'dns'
:
dns
})
for
ifname
,
conf
in
data
:
subprocess
.
call
((
'/sbin/ifup'
,
ifname
))
# example:
# example:
...
...
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