mds_plugin/compute.py
def format_vnic_listing(vnics):
    """Returns a formated list of vnics.

    Args:
        vnics (list): A list of vnics objects.

    Returns:
        The formated list as string
    """
    import re

    out = ""
    i = 1
    for v in vnics:
        # Shorten to 24 chars max, remove linebreaks
        name = re.sub(r'[\n\r]', ' ',
                      v.display_name[:22] + '..'
                      if len(v.display_name) > 24
                      else v.display_name)

        private_ip = v.private_ip if v.private_ip else ""
        public_ip = v.public_ip if v.public_ip else ""

        out += (f"{i:>4} {name:24} {private_ip:15} {public_ip:15} "
                f"{v.lifecycle_state[:8]:8} {v.time_created:%Y-%m-%d %H:%M}\n")
        i += 1

    return out
Returns a formated list of vnics.

    Args:
        vnics (list): A list of vnics objects.

    Returns:
        The formated list as string
    
Returns a formated list of vnics.
Returns a formated list of vnics .
def format_vnic_listing(vnics):
    import re
    out = ""
    i = 1
    for v in vnics:
        name = re.sub(r'[\n\r]', ' ',
                      v.display_name[:22] + '..'
                      if len(v.display_name) > 24
                      else v.display_name)
        private_ip = v.private_ip if v.private_ip else ""
        public_ip = v.public_ip if v.public_ip else ""
        out += (f"{i:>4} {name:24} {private_ip:15} {public_ip:15} "
                f"{v.lifecycle_state[:8]:8} {v.time_created:%Y-%m-%d %H:%M}\n")
        i += 1
    return out
def format_vnic_listing ( vnics ) : import re out = "" i = 1 for v in vnics : name = re . sub ( r'[\n\r]' , ' ' , v . display_name [ : 22 ] + '..' if len ( v . display_name ) > 24 else v . display_name ) private_ip = v . private_ip if v . private_ip else "" public_ip = v . public_ip if v . public_ip else "" out += ( f"{i:>4} {name:24} {private_ip:15} {public_ip:15} " f"{v.lifecycle_state[:8]:8} {v.time_created:%Y-%m-%d %H:%M}\n" ) i += 1 return out
Returns a formated list of vnics.
Returns a formated list of vnics .
"""Returns a formated list of vnics.

    Args:
        vnics (list): A list of vnics objects.

    Returns:
        The formated list as string
    """ # Shorten to 24 chars max, remove linebreaks

The formated list as string
The formated list as string
vnics
A list of vnics objects.
A list of vnics objects .