<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GRACEFUL_DISCONNECT_WAIT_SEC does not work in Tools</title>
    <link>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092353#M3522</link>
    <description>&lt;P&gt;Hmm... from what you&amp;nbsp;&lt;SPAN&gt;describe, it seems that the 10-second delay you are see is not directly related to &lt;CODE&gt;GRACEFUL_DISCONNECT_WAIT_SEC&lt;/CODE&gt;&amp;nbsp;/&amp;nbsp;&lt;CODE&gt;POST_DISCONNECT_WAIT_SEC&lt;/CODE&gt;&amp;nbsp;settings. It might be caused by a combination a few things such as network latency, connection timeouts, or device-specific limitations.&amp;nbsp;&lt;/SPAN&gt;I am also unsure if the &lt;CODE&gt;genielibs&lt;/CODE&gt; library might have additional logic for disconnection that overrides your settings too (guessing here)?&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 10:17:08 GMT</pubDate>
    <dc:creator>bigevilbeard</dc:creator>
    <dc:date>2024-05-07T10:17:08Z</dc:date>
    <item>
      <title>GRACEFUL_DISCONNECT_WAIT_SEC does not work</title>
      <link>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092342#M3521</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;I have a small script that collects information from a list of devices, but it takes a long time.&lt;/P&gt;
&lt;P&gt;I have found out that there is a disconnection time of 10s I think I am hitting.&lt;/P&gt;
&lt;P&gt;I have found the documentation that says I can change the settings but when I test it out there is still a delay after the disconnect.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;def atswrapper_bfd(dev_ip, cli_username, cli_password):
    atsbfd = None
    testbed = loader.load(
        {
            "devices": {
                device["name"]: {
                    "connections": {
                        "cli": {
                            "protocol": "ssh",
                            "ip": dev_ip,
                            "init_exec_commands": [],
                            "init_config_commands": []
                        },
                        "settings": {
                            "GRACEFUL_DISCONNECT_WAIT_SEC": 1,
                            "POST_DISCONNECT_WAIT_SEC": 1
                        }
                    }, # Find a better way to do this: https://github.com/CiscoTestAutomation/genielibs/issues/12
                    "credentials": {
                        "default": {
                            "username": cli_username,
                            "password": cli_password,
                        }
                    },
                    "type": "Device",
                    "os": "iosxe"
                }
            }
        }
    )
    atsdevice = testbed.devices[device["name"]]
    atsdevice.connect(via='cli', log_stdout=True, learn_hostname=True, connection_timeout=2)

    atsbfd = atsdevice.parse('show bfd neighbors details')
    atsdevice.disconnect()
    return atsbfd&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 May 2024 10:09:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092342#M3521</guid>
      <dc:creator>rasmus.elmholt</dc:creator>
      <dc:date>2024-05-07T10:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: GRACEFUL_DISCONNECT_WAIT_SEC does not work</title>
      <link>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092353#M3522</link>
      <description>&lt;P&gt;Hmm... from what you&amp;nbsp;&lt;SPAN&gt;describe, it seems that the 10-second delay you are see is not directly related to &lt;CODE&gt;GRACEFUL_DISCONNECT_WAIT_SEC&lt;/CODE&gt;&amp;nbsp;/&amp;nbsp;&lt;CODE&gt;POST_DISCONNECT_WAIT_SEC&lt;/CODE&gt;&amp;nbsp;settings. It might be caused by a combination a few things such as network latency, connection timeouts, or device-specific limitations.&amp;nbsp;&lt;/SPAN&gt;I am also unsure if the &lt;CODE&gt;genielibs&lt;/CODE&gt; library might have additional logic for disconnection that overrides your settings too (guessing here)?&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 10:17:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092353#M3522</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-05-07T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: GRACEFUL_DISCONNECT_WAIT_SEC does not work</title>
      <link>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092487#M3523</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/352839"&gt;@bigevilbeard&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I look at the logs it gives from log_stdout=True it completes the show command, hangs for 10 seconds and then continue.&lt;/P&gt;
&lt;P&gt;I have tried to add the following lines and then the function is a lot faster.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
atsdevice = testbed.devices[device["name"]]
    atsdevice.connect(via='cli', log_stdout=True, learn_hostname=True, connection_timeout=2)

    atsdevice.settings.GRACEFUL_DISCONNECT_WAIT_SEC = 0
    atsdevice.settings.POST_DISCONNECT_WAIT_SEC  = 0

    atsbfd = atsdevice.parse('show bfd neighbors details')
    atsdevice.disconnect()

&lt;/LI-CODE&gt;
&lt;P&gt;But I still cannot get it to work when using the dictionary with configuration.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 12:14:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092487#M3523</guid>
      <dc:creator>rasmus.elmholt</dc:creator>
      <dc:date>2024-05-07T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: GRACEFUL_DISCONNECT_WAIT_SEC does not work</title>
      <link>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092505#M3524</link>
      <description>&lt;P&gt;Not sure if this would work, but try this idea below,&amp;nbsp;&lt;SPAN&gt;the GRACEFUL_DISCONNECT_WAIT_SEC and POST_DISCONNECT_WAIT_SEC settings are now set within the settings key of the device dictionary, it _should_ correctly set the values and reduce the delay between sending the show command and disconnecting from the device. (I hope!)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def atswrapper_bfd(dev_ip, cli_username, cli_password):
    atsbfd = None
    testbed = loader.load(
        {
            "devices": {
                device["name"]: {
                    "connections": {
                        "cli": {
                            "protocol": "ssh",
                            "ip": dev_ip,
                            "init_exec_commands": [],
                            "init_config_commands": []
                        }
                    },
                    "credentials": {
                        "default": {
                            "username": cli_username,
                            "password": cli_password,
                        }
                    },
                    "type": "Device",
                    "os": "iosxe",
                    "settings": {
                        "GRACEFUL_DISCONNECT_WAIT_SEC": 0,
                        "POST_DISCONNECT_WAIT_SEC": 0
                    }
                }
            }
        }
    )
    atsdevice = testbed.devices[device["name"]]
    atsdevice.connect(via='cli', log_stdout=True, learn_hostname=True, connection_timeout=2)

    atsbfd = atsdevice.parse('show bfd neighbors details')
    atsdevice.disconnect()
    return atsbfd&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 12:44:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/graceful-disconnect-wait-sec-does-not-work/m-p/5092505#M3524</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-05-07T12:44:19Z</dc:date>
    </item>
  </channel>
</rss>

