def ports(self):
        """
        :return: dictionary {name: object} of all ports.
        """

        ports = {}
        for chassis in self.chassis_list.values():
            ports.update({str(p): p for p in chassis.get_objects_by_type('port')})
        return ports
def ports ( self ) : ports = { } for chassis in self . chassis_list . values ( ) : ports . update ( { str ( p ) : p for p in chassis . get_objects_by_type ( 'port' ) } ) return ports
:return: dictionary {name: object} of all ports.