Module Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias alias alias ImportFrom alias identifier Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Call AttributeLoad NameLoad attr Str keyword Num keyword Call NameLoad Str Call AttributeLoad NameLoad attr Str keyword Num keyword Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Str Str Str Str NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Return NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str If CompareEq SubscriptLoad NameLoad Index Str Str body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body If CompareEq SubscriptLoad NameLoad Index Str NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad orelse Continue Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Return NameLoad If UnaryOpNot Call NameLoad SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str Str If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Str Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Str Assign NameStore NameLoad If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad CompareIs NameLoad NameLoad body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str Call NameLoad Call AttributeLoad NameLoad attr BinOpAdd SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict Str NameLoad Expr Call AttributeLoad NameLoad attr Str Dict Str Str NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str ListLoad ListLoad ListLoad Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str If UnaryOpNot Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad SubscriptLoad NameLoad Index Str Continue Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str If Call NameLoad SubscriptLoad NameLoad Index Str body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str NameLoad SubscriptLoad NameLoad Index Str orelse Expr Call AttributeLoad NameLoad attr Call NameLoad Str Dict Str Str Str NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Str orelse If CompareEq NameLoad Str body If Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Str Dict Str Str Str NameLoad SubscriptLoad NameLoad Index Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list decorator_list
N/A N/A datetime oslo_config cfg oslo_log log logging oslo_utils timeutils networking_cisco._i18n _ _LI _LW neutron.agent.linux utils linux_utils N/A pprint N/A LOG N/A N/A logging getLogger __name__ N/A STATUS_OPTS N/A N/A N/A cfg IntOpt device_connection_timeout default 30 help N/A _ Time in seconds for connecting to a hosting device N/A N/A cfg IntOpt hosting_device_dead_timeout default 300 help N/A _ The time in seconds until a backlogged hosting device is presumed dead. This value should be set up high enough to recover from a period of connectivity loss or high load when the device may not be responding. N/A N/A N/A N/A cfg CONF register_opts STATUS_OPTS cfg_agent _is_pingable N/A N/A ip N/A N/A N/A Checks whether an IP address is reachable by pinging.

    Use linux utils to execute the ping (ICMP ECHO) command.
    Sends 5 packets with an interval of 0.2 seconds and timeout of 1
    seconds. Runtime error implies unreachability else IP is pingable.
    :param ip: IP to check
    :return: bool - True or False depending on pingability.
     N/A ping_cmd N/A ping -c 5 -W 1 -i 0.2 ip N/A N/A N/A N/A N/A linux_utils execute ping_cmd check_exit_code True N/A True N/A N/A N/A RuntimeError N/A N/A N/A N/A LOG warning N/A _LW Cannot ping ip address: %s ip N/A False N/A DeviceStatus N/A object N/A N/A Device status and backlog processing. N/A _instance None __new__ N/A N/A cls N/A N/A N/A N/A N/A cls _instance N/A N/A N/A cls _instance N/A N/A N/A super DeviceStatus cls __new__ cls N/A N/A cls _instance N/A __init__ N/A N/A self N/A N/A N/A N/A self backlog_hosting_devices N/A N/A N/A self enable_heartbeat False N/A get_backlogged_hosting_devices N/A N/A self N/A N/A N/A N/A N/A N/A self backlog_hosting_devices keys N/A get_backlogged_hosting_devices_info N/A N/A self N/A N/A N/A resp N/A N/A self get_monitored_hosting_devices_info hd_state_filter Dead N/A resp N/A get_dead_hosting_devices_info N/A N/A self N/A N/A N/A 
        Get a list of hosting devices that have been marked dead
        :return: List of dead hosting device ids
         N/A res N/A N/A hd_id N/A self backlog_hosting_devices N/A N/A hd N/A N/A N/A self backlog_hosting_devices N/A hd_id N/A hd N/A N/A N/A hd N/A hd_state Dead N/A N/A N/A N/A res append N/A hd N/A id N/A res N/A get_monitored_hosting_devices_info N/A N/A self hd_state_filter N/A None N/A N/A 
        This function returns a list of all hosting devices monitored
        by this agent
         N/A wait_time N/A N/A datetime timedelta seconds N/A N/A N/A cfg CONF cfg_agent hosting_device_dead_timeout N/A resp N/A N/A hd_id N/A self backlog_hosting_devices N/A N/A hd N/A N/A N/A self backlog_hosting_devices N/A hd_id N/A hd N/A display_hd True N/A N/A hd_state_filter None N/A N/A N/A N/A hd N/A hd_state hd_state_filter N/A N/A display_hd True N/A N/A display_hd False N/A display_hd N/A N/A created_time N/A hd N/A created_at N/A boottime N/A N/A datetime timedelta seconds N/A hd N/A booting_time N/A backlogged_at N/A hd N/A backlog_insertion_ts N/A booted_at N/A created_time boottime N/A dead_at N/A backlogged_at wait_time N/A N/A N/A resp append N/A host id hd_state created at backlogged at estimate booted at considered dead at N/A hd N/A id N/A hd N/A hd_state N/A str created_time N/A str backlogged_at N/A str booted_at N/A str dead_at N/A N/A N/A resp N/A is_hosting_device_reachable N/A N/A self hosting_device N/A N/A N/A Check the hosting device which hosts this resource is reachable.

        If the resource is not reachable, it is added to the backlog.

        * heartbeat revision
        We want to enqueue all hosting-devices into the backlog for
        monitoring purposes

        adds key/value pairs to  hd (aka hosting_device dictionary)

        _is_pingable : if it returns true,
            hd['hd_state']='Active'
        _is_pingable : if it returns false,
            hd['hd_state']='Unknown'

        :param hosting_device : dict of the hosting device
        :return True if device is reachable, else None
         N/A ret_val False N/A hd hosting_device N/A hd_id N/A hosting_device N/A id N/A hd_mgmt_ip N/A hosting_device N/A management_ip_address N/A dead_hd_list N/A N/A self get_dead_hosting_devices_info N/A N/A hd_id dead_hd_list N/A N/A N/A N/A LOG debug Hosting device: %(hd_id)s@%(ip)s is already marked as Dead. It is assigned as non-reachable N/A hd_id ip hd_id hd_mgmt_ip N/A False N/A N/A N/A isinstance N/A hd N/A created_at N/A datetime datetime N/A N/A N/A hd N/A created_at N/A N/A N/A datetime datetime strptime N/A hd N/A created_at %Y-%m-%d %H:%M:%S N/A N/A _is_pingable hd_mgmt_ip N/A N/A N/A N/A LOG debug Hosting device: %(hd_id)s@%(ip)s is reachable. N/A hd_id ip hd_id hd_mgmt_ip N/A N/A hd N/A hd_state Active N/A ret_val True N/A N/A N/A N/A LOG debug Hosting device: %(hd_id)s@%(ip)s is NOT reachable. N/A hd_id ip hd_id hd_mgmt_ip N/A N/A hd N/A hd_state Unknown N/A ret_val False N/A N/A N/A N/A self enable_heartbeat True N/A ret_val False N/A N/A N/A hd_id N/A self backlog_hosting_devices N/A N/A N/A hd N/A backlog_insertion_ts N/A max N/A N/A timeutils utcnow N/A N/A hd N/A created_at N/A N/A datetime timedelta seconds N/A hd N/A booting_time N/A N/A N/A self backlog_hosting_devices N/A hd_id N/A hd hd N/A N/A N/A LOG debug Hosting device: %(hd_id)s @ %(ip)s is now added to backlog N/A hd_id ip hd_id hd_mgmt_ip N/A ret_val N/A check_backlogged_hosting_devices N/A N/A self N/A N/A N/A "Checks the status of backlogged hosting devices.

        Skips newly spun up instances during their booting time as specified
        in the boot time parameter.

        Each hosting-device tracked has a key, hd_state, that represents the
        last known state for the hosting device.  Valid values for hd_state
        are ['Active', 'Unknown', 'Dead']

        Each time check_backlogged_hosting_devices is invoked, a ping-test
        is performed to determine the current state.  If the current state
        differs, hd_state is updated.

        The hd_state transitions/actions are represented by the following
        table.

        current /    Active                 Unknown          Dead
        last state
        Active       Device is reachable.   Device was       Dead device
                     No state change        temporarily      recovered.
                     unreachable.     Trigger resync
        Unknown      Device connectivity    Device           Not a valid
                     test failed.  Set      connectivity     state
                     backlog timestamp      test failed.     transition.
                     and wait for dead      Dead timeout
                     timeout to occur.      has not
                                            occurred yet.
        Dead         Not a valid state      Dead timeout     Device is
                     transition.            for device has   still dead.
                                            elapsed.         No state
                                            Notify plugin    change.

        :return A dict of the format:
        {'reachable': [<hd_id>,..],'dead':[<hd_id>,..],'revived':[<hd_id>,..]}
        reachable - a list of hosting devices that are now reachable
        dead      - a list of hosting devices deemed dead
        revived   - a list of hosting devices (dead to active)
         N/A response_dict N/A reachable revived dead N/A N/A N/A N/A N/A N/A LOG debug Current Backlogged hosting devices: 
%s
 N/A N/A N/A self backlog_hosting_devices keys N/A hd_id N/A N/A N/A self backlog_hosting_devices keys N/A N/A hd N/A N/A N/A self backlog_hosting_devices N/A hd_id N/A hd N/A N/A N/A N/A timeutils is_older_than N/A hd N/A created_at N/A hd N/A booting_time N/A N/A N/A N/A LOG info N/A _LI Hosting device: %(hd_id)s @ %(ip)s hasn't passed minimum boot time. Skipping it.  N/A hd_id ip hd_id N/A hd N/A management_ip_address N/A N/A N/A N/A LOG info N/A _LI Checking hosting device: %(hd_id)s @ %(ip)s for reachability. N/A hd_id ip hd_id N/A hd N/A management_ip_address N/A hd_state N/A hd N/A hd_state N/A N/A _is_pingable N/A hd N/A management_ip_address N/A N/A N/A hd_state Unknown N/A N/A N/A N/A LOG debug N/A hosting devices revived & reachable, %s N/A N/A pprint pformat hd N/A N/A hd N/A hd_state Active N/A N/A N/A N/A response_dict N/A revived append hd_id N/A N/A N/A N/A response_dict N/A reachable append hd_id N/A N/A N/A hd_state Dead N/A N/A N/A N/A LOG debug N/A Dead hosting devices revived %s N/A N/A pprint pformat hd N/A N/A hd N/A hd_state Active N/A N/A N/A N/A response_dict N/A revived append hd_id N/A N/A N/A N/A LOG debug N/A No-op._is_pingable is True and current hd['hd_state']=%s hd_state N/A N/A N/A LOG info N/A _LI Hosting device: %(hd_id)s @ %(ip)s is now reachable. Adding it to response N/A hd_id ip hd_id N/A hd N/A management_ip_address N/A N/A N/A N/A LOG info N/A _LI Hosting device: %(hd_id)s %(hd_state)s @ %(ip)s not reachable  N/A hd_id hd_state ip hd_id N/A hd N/A hd_state N/A hd N/A management_ip_address N/A N/A hd_state Active N/A N/A N/A N/A LOG debug N/A hosting device lost connectivity, %s N/A N/A pprint pformat hd N/A N/A hd N/A backlog_insertion_ts N/A N/A timeutils utcnow N/A N/A hd N/A hd_state Unknown N/A N/A N/A hd_state Unknown N/A N/A N/A N/A timeutils is_older_than N/A hd N/A backlog_insertion_ts N/A N/A N/A cfg CONF cfg_agent hosting_device_dead_timeout N/A N/A N/A hd N/A hd_state Dead N/A N/A N/A LOG debug Hosting device: %(hd_id)s @ %(ip)s hasn't been reachable for the last %(time)d seconds. Marking it dead. N/A hd_id ip time hd_id N/A hd N/A management_ip_address N/A N/A N/A cfg CONF cfg_agent hosting_device_dead_timeout N/A N/A N/A N/A response_dict N/A dead append hd_id N/A N/A N/A LOG debug Response: %s response_dict N/A response_dict N/A N/A