← Back to team overview

cloud-init team mailing list archive

Re: use of network utilities

 

On 17/12/2017 14:49, Mamfelt wrote:
the command ‘ip’ and family do not exist on AIX.

Sent from my iPhone

On 17 Dec 2017, at 13:16, Robert Schweikert<rjschwei@xxxxxxxx>  wrote:

Hi,

We are deprecating support for

arp
ifconfig
netstat
route

But cloud-init still uses these commands (spare the 'arp' command) in
some places, namely:

cc_disable_ec2_metadata.py uses 'route'
netinfo.py uses 'ifconfig' and 'netstat'

The question is, do we expect cloud-init (spare freebsd) to run only on
distributions that support the new commands provided by iproute2?

I am asking because in cloudinit/net/__init__.py the 'ip' command is
used unconditonally, i.e. it is assumed that the 'ip' command exists. if
this is the case we should be able to replace the 'route', 'ifconfig',
and 'ntestat' commands in the other parts of the code as well.

Thoughts?
I have been trying - for much too long - to get support for ctypes.util.find_library() (in core python) to be fixed.

Currently, the change in the (core) util.py is:

if sys.platform.startswith("aix"):
    # AIX has two styles of storing shared libraries
    # GNU auto_tools refer to these as svr4 and aix
    # svr4 (System V Release 4) is a regular file, often with .so as suffix
    # AIX style uses an archive (suffix .a) with members (e.g., shr.o, libssl.so)
    # see issue#26439 and _aix.py for more details

    from ctypes._aix import find_library

elif os.name == "posix":
...

So, if what and how these routines are defined clearly - then the implementation becomes less critical. Maybe the new definition(s) maps 1::1 with ip command outputs, but having that documented explicitly will be needed for "classic posix" such as freebsd and/or AIX.

On the other hand - you can ignore AIX - as the path they choose (to accept) was to hack out one definition (replacing it with "aix") and add some other files where the core did not work asis. Since then this has been stuck on cloud-init-7.5. (A year ago I started on this, but for many reasons, one of them being the confusion I have with cpthyon re: what is a bug and what is a new core feature - that I have not been thrilled to be busy with anything python.

So - in summary - my thoughts are two-fold:

a) like freebsd AIX has no support for the "ip" family of commands.
b) I still hope to have time to develop real support for AIX - in a way it can be included in 'trunk' aka 'master'. Explicit documentation helps. Reverse engineering is such a bore.

Sincerely,

Michael Felt

Thanks,
Robert

--
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Distinguished Architect                       LINUX
Team Lead Public Cloud
rjschwei@xxxxxxxx
IRC: robjo



References