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
cc783b3e
Commit
cc783b3e
authored
Dec 05, 2013
by
Alfons Zitterbacke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added AIX network facts
parent
cbfeb0a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
library/system/setup
+55
-0
No files found.
library/system/setup
View file @
cc783b3e
...
...
@@ -1785,6 +1785,61 @@ class FreeBSDNetwork(GenericBsdIfconfigNetwork, Network):
"""
platform
=
'FreeBSD'
class
AIXNetwork
(
GenericBsdIfconfigNetwork
,
Network
):
"""
This is the FreeBSD Network Class.
It uses the GenericBsdIfconfigNetwork unchanged.
"""
platform
=
'AIX'
# AIX 'ifconfig -a' does not have three words in the interface line
def
get_interfaces_info
(
self
,
ifconfig_path
):
interfaces
=
{}
current_if
=
{}
ips
=
dict
(
all_ipv4_addresses
=
[],
all_ipv6_addresses
=
[],
)
rc
,
out
,
err
=
module
.
run_command
([
ifconfig_path
,
'-a'
])
for
line
in
out
.
split
(
'
\n
'
):
if
line
:
words
=
line
.
split
()
# only this condition differs from GenericBsdIfconfigNetwork
if
re
.
match
(
'^
\
w*
\
d*:'
,
line
):
current_if
=
self
.
parse_interface_line
(
words
)
interfaces
[
current_if
[
'device'
]
]
=
current_if
elif
words
[
0
]
.
startswith
(
'options='
):
self
.
parse_options_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'nd6'
:
self
.
parse_nd6_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'ether'
:
self
.
parse_ether_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'media:'
:
self
.
parse_media_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'status:'
:
self
.
parse_status_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'lladdr'
:
self
.
parse_lladdr_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'inet'
:
self
.
parse_inet_line
(
words
,
current_if
,
ips
)
elif
words
[
0
]
==
'inet6'
:
self
.
parse_inet6_line
(
words
,
current_if
,
ips
)
else
:
self
.
parse_unknown_line
(
words
,
current_if
,
ips
)
return
interfaces
,
ips
# AIX 'ifconfig -a' does not inform about MTU, so remove current_if['mtu'] here
def
parse_interface_line
(
self
,
words
):
device
=
words
[
0
][
0
:
-
1
]
current_if
=
{
'device'
:
device
,
'ipv4'
:
[],
'ipv6'
:
[],
'type'
:
'unknown'
}
current_if
[
'flags'
]
=
self
.
get_options
(
words
[
1
])
current_if
[
'macaddress'
]
=
'unknown'
# will be overwritten later
return
current_if
class
OpenBSDNetwork
(
GenericBsdIfconfigNetwork
,
Network
):
"""
This is the OpenBSD Network Class.
...
...
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