Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
7eadf780
Commit
7eadf780
authored
11 years ago
by
James Tanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4282 from cristobalrosa/ansible
Add a fact for checking if interface is in promiscuous mode.
parents
d0986a20
617f7bb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
library/system/setup
+10
-0
No files found.
library/system/setup
View file @
7eadf780
...
...
@@ -1445,6 +1445,16 @@ class LinuxNetwork(Network):
if
os
.
path
.
exists
(
path
):
interfaces
[
device
][
'all_slaves_active'
]
=
open
(
path
)
.
read
()
==
'1'
# Check whether a interface is in promiscuous mode
if
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
'flags'
)):
promisc_mode
=
False
# The second byte indicates whether the interface is in promiscuous mode.
# 1 = promisc
# 0 = no promisc
data
=
int
(
open
(
os
.
path
.
join
(
path
,
'flags'
))
.
read
()
.
strip
(),
16
)
promisc_mode
=
(
data
&
0x0100
>
0
)
interfaces
[
device
][
'promisc'
]
=
promisc_mode
def
parse_ip_output
(
output
,
secondary
=
False
):
for
line
in
output
.
split
(
'
\n
'
):
if
not
line
:
...
...
This diff is collapsed.
Click to expand it.
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