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
a59784a5
Commit
a59784a5
authored
Mar 10, 2015
by
Boris Manojlovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use full path to command instead use module.get_bin_path
parent
0f4cf8cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
lib/ansible/module_utils/facts.py
+34
-29
No files found.
lib/ansible/module_utils/facts.py
View file @
a59784a5
...
...
@@ -2179,35 +2179,40 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
self
.
parse_inet6_line
(
words
,
current_if
,
ips
)
else
:
self
.
parse_unknown_line
(
words
,
current_if
,
ips
)
rc
,
out
,
err
=
module
.
run_command
([
'/usr/bin/uname'
,
'-W'
])
# don't bother with wpars it does not work
# zero means not in wpar
if
out
.
split
()[
0
]
==
'0'
:
if
current_if
[
'macaddress'
]
==
'unknown'
and
re
.
match
(
'^en'
,
current_if
[
'device'
]):
rc
,
out
,
err
=
module
.
run_command
([
'/usr/bin/entstat'
,
current_if
[
'device'
]
])
if
rc
!=
0
:
break
for
line
in
out
.
split
(
'
\n
'
):
if
not
line
:
pass
buff
=
re
.
match
(
'^Hardware Address: (.*)'
,
line
)
if
buff
:
current_if
[
'macaddress'
]
=
buff
.
group
(
1
)
buff
=
re
.
match
(
'^Device Type:'
,
line
)
if
buff
and
re
.
match
(
'.*Ethernet'
,
line
):
current_if
[
'type'
]
=
'ether'
# device must have mtu attribute in ODM
if
'mtu'
not
in
current_if
:
rc
,
out
,
err
=
module
.
run_command
([
'/usr/sbin/lsattr'
,
'-El'
,
current_if
[
'device'
]
])
if
rc
!=
0
:
break
for
line
in
out
.
split
(
'
\n
'
):
if
line
:
words
=
line
.
split
()
if
words
[
0
]
==
'mtu'
:
current_if
[
'mtu'
]
=
words
[
1
]
uname_path
=
module
.
get_bin_path
(
'uname'
)
if
uname_path
:
rc
,
out
,
err
=
module
.
run_command
([
uname_path
,
'-W'
])
# don't bother with wpars it does not work
# zero means not in wpar
if
out
.
split
()[
0
]
==
'0'
:
if
current_if
[
'macaddress'
]
==
'unknown'
and
re
.
match
(
'^en'
,
current_if
[
'device'
]):
entstat_path
=
module
.
get_bin_path
(
'entstat'
)
if
entstat_path
:
rc
,
out
,
err
=
module
.
run_command
([
entstat_path
,
current_if
[
'device'
]
])
if
rc
!=
0
:
break
for
line
in
out
.
split
(
'
\n
'
):
if
not
line
:
pass
buff
=
re
.
match
(
'^Hardware Address: (.*)'
,
line
)
if
buff
:
current_if
[
'macaddress'
]
=
buff
.
group
(
1
)
buff
=
re
.
match
(
'^Device Type:'
,
line
)
if
buff
and
re
.
match
(
'.*Ethernet'
,
line
):
current_if
[
'type'
]
=
'ether'
# device must have mtu attribute in ODM
if
'mtu'
not
in
current_if
:
lsattr_path
=
module
.
get_bin_path
(
'lsattr'
)
if
lsattr_path
:
rc
,
out
,
err
=
module
.
run_command
([
lsattr_path
,
'-El'
,
current_if
[
'device'
]
])
if
rc
!=
0
:
break
for
line
in
out
.
split
(
'
\n
'
):
if
line
:
words
=
line
.
split
()
if
words
[
0
]
==
'mtu'
:
current_if
[
'mtu'
]
=
words
[
1
]
return
interfaces
,
ips
# AIX 'ifconfig -a' does not inform about MTU, so remove current_if['mtu'] here
...
...
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