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):
...
@@ -2179,35 +2179,40 @@ class AIXNetwork(GenericBsdIfconfigNetwork, Network):
self
.
parse_inet6_line
(
words
,
current_if
,
ips
)
self
.
parse_inet6_line
(
words
,
current_if
,
ips
)
else
:
else
:
self
.
parse_unknown_line
(
words
,
current_if
,
ips
)
self
.
parse_unknown_line
(
words
,
current_if
,
ips
)
uname_path
=
module
.
get_bin_path
(
'uname'
)
rc
,
out
,
err
=
module
.
run_command
([
'/usr/bin/uname'
,
'-W'
])
if
uname_path
:
# don't bother with wpars it does not work
rc
,
out
,
err
=
module
.
run_command
([
uname_path
,
'-W'
])
# zero means not in wpar
# don't bother with wpars it does not work
if
out
.
split
()[
0
]
==
'0'
:
# zero means not in wpar
if
current_if
[
'macaddress'
]
==
'unknown'
and
re
.
match
(
'^en'
,
current_if
[
'device'
]):
if
out
.
split
()[
0
]
==
'0'
:
rc
,
out
,
err
=
module
.
run_command
([
'/usr/bin/entstat'
,
current_if
[
'device'
]
])
if
current_if
[
'macaddress'
]
==
'unknown'
and
re
.
match
(
'^en'
,
current_if
[
'device'
]):
if
rc
!=
0
:
entstat_path
=
module
.
get_bin_path
(
'entstat'
)
break
if
entstat_path
:
for
line
in
out
.
split
(
'
\n
'
):
rc
,
out
,
err
=
module
.
run_command
([
entstat_path
,
current_if
[
'device'
]
])
if
not
line
:
if
rc
!=
0
:
pass
break
buff
=
re
.
match
(
'^Hardware Address: (.*)'
,
line
)
for
line
in
out
.
split
(
'
\n
'
):
if
buff
:
if
not
line
:
current_if
[
'macaddress'
]
=
buff
.
group
(
1
)
pass
buff
=
re
.
match
(
'^Hardware Address: (.*)'
,
line
)
buff
=
re
.
match
(
'^Device Type:'
,
line
)
if
buff
:
if
buff
and
re
.
match
(
'.*Ethernet'
,
line
):
current_if
[
'macaddress'
]
=
buff
.
group
(
1
)
current_if
[
'type'
]
=
'ether'
# device must have mtu attribute in ODM
buff
=
re
.
match
(
'^Device Type:'
,
line
)
if
'mtu'
not
in
current_if
:
if
buff
and
re
.
match
(
'.*Ethernet'
,
line
):
rc
,
out
,
err
=
module
.
run_command
([
'/usr/sbin/lsattr'
,
'-El'
,
current_if
[
'device'
]
])
current_if
[
'type'
]
=
'ether'
if
rc
!=
0
:
# device must have mtu attribute in ODM
break
if
'mtu'
not
in
current_if
:
for
line
in
out
.
split
(
'
\n
'
):
lsattr_path
=
module
.
get_bin_path
(
'lsattr'
)
if
line
:
if
lsattr_path
:
words
=
line
.
split
()
rc
,
out
,
err
=
module
.
run_command
([
lsattr_path
,
'-El'
,
current_if
[
'device'
]
])
if
words
[
0
]
==
'mtu'
:
if
rc
!=
0
:
current_if
[
'mtu'
]
=
words
[
1
]
break
for
line
in
out
.
split
(
'
\n
'
):
if
line
:
words
=
line
.
split
()
if
words
[
0
]
==
'mtu'
:
current_if
[
'mtu'
]
=
words
[
1
]
return
interfaces
,
ips
return
interfaces
,
ips
# AIX 'ifconfig -a' does not inform about MTU, so remove current_if['mtu'] here
# 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