<?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: Suppress Genie output when using in a script in Tools</title>
    <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535801#M650</link>
    <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/916816"&gt;@Jeremy Schulman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is a blast from the past but would you be willing to take a walk down memory lane and walk me through how you found this?&amp;nbsp; I've spent hours trying it myself.&amp;nbsp; I think my hold up is I can't even find the connect method that the object of class genie.libs.conf.device.nxos.device.Device can run to inspect the code.&amp;nbsp; I looked into all the inherited classes but didn't find a connect method.&amp;nbsp; Using the inspect module it looks like it my be written in C and maybe thats why I can't see the code.&amp;nbsp; How did you find out the exact syntax to use?&lt;/P&gt;&lt;P&gt;I'm using this code in ipython to test&lt;/P&gt;&lt;PRE&gt;from genie import testbed
tb = testbed.load(".\testbed.yaml")
core1 = tb.devices.Core1
core1.connect()&lt;/PRE&gt;</description>
    <pubDate>Fri, 21 Jan 2022 15:33:31 GMT</pubDate>
    <dc:creator>jmattbullen</dc:creator>
    <dc:date>2022-01-21T15:33:31Z</dc:date>
    <item>
      <title>Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3893008#M495</link>
      <description>&lt;P&gt;I'm playing around with using Genie in a python script. Whenever I do anything with Genie, like device.connect(), it prints the output to the console. How do I suppress that?&amp;nbsp; Thanks, Mike&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 18:17:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3893008#M495</guid>
      <dc:creator>Mike Assel</dc:creator>
      <dc:date>2019-07-18T18:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3939356#M499</link>
      <description>&lt;P&gt;Given a device instance, you can change the log settings via the connectionmgr instance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE&gt;import logging&lt;BR /&gt;&lt;BR /&gt;# dev is a Device instance from a testbed&lt;BR /&gt;&lt;BR /&gt;dev.connectionmgr.log.setLevel(logging.ERROR)&lt;BR /&gt;&lt;BR /&gt;# now execute a command and you will not see the output on the console&lt;BR /&gt;resp = dev.execute('show version')&lt;BR /&gt;&lt;BR /&gt;# you can print the response&lt;BR /&gt;print(resp)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 15:38:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3939356#M499</guid>
      <dc:creator>Jeremy Schulman</dc:creator>
      <dc:date>2019-10-11T15:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3940833#M500</link>
      <description>After further research, there are two other methods:&lt;BR /&gt;&lt;BR /&gt;1) When you initially connect to a device, you can pass the argument dev.connect(log_stdout=False) to disable logging; this disable will be in-effect for the entire session until you re-enable it.&lt;BR /&gt;&lt;BR /&gt;2) The device instance, after connection, provide a dev.log_user() method, which can be enabled/disabled passing True/False.</description>
      <pubDate>Tue, 15 Oct 2019 12:29:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3940833#M500</guid>
      <dc:creator>Jeremy Schulman</dc:creator>
      <dc:date>2019-10-15T12:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944124#M504</link>
      <description>&lt;P&gt;Thanks Jeremy! That did the trick. However when I use dev.connect(log_stdout=False) then the output is not logged to a file. A few follow up questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How did you find dev.connect(log_stdout=False) ???? I did a lot of googling and NOTHING comes up (other than your blog post &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;Assuming I can disable logging to the console but enable logging to a file, how would I specify the path?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 21 Oct 2019 01:14:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944124#M504</guid>
      <dc:creator>Mike Assel</dc:creator>
      <dc:date>2019-10-21T01:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944146#M505</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/317775"&gt;@Mike Assel&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;re: connect(log_stdout=False) I learned via a response on Twitter from one of the DevNet genie developers.&amp;nbsp; After I learned this, I did a scan of the sourcecode and I could not find any reference to this Device() argument either.&amp;nbsp; Seem like an opportunity for the DevNet team to add more documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;re: logging - even though the console logging is disabled, there is still a logfile.&amp;nbsp; You can find it using the Device.logfile attribute, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;In [11]: dev.logfile
Out[11]: '/tmp/atlrs21-cli-20191021T024126194.log'&lt;/PRE&gt;&lt;P&gt;I have not experimented with changing the logfile value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 02:47:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944146#M505</guid>
      <dc:creator>Jeremy Schulman</dc:creator>
      <dc:date>2019-10-21T02:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944579#M506</link>
      <description>&lt;P&gt;My bad. I had checked and thought I did not see a log file, but I checked again and indeed it was there. Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 13:36:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/3944579#M506</guid>
      <dc:creator>Mike Assel</dc:creator>
      <dc:date>2019-10-21T13:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535801#M650</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/916816"&gt;@Jeremy Schulman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is a blast from the past but would you be willing to take a walk down memory lane and walk me through how you found this?&amp;nbsp; I've spent hours trying it myself.&amp;nbsp; I think my hold up is I can't even find the connect method that the object of class genie.libs.conf.device.nxos.device.Device can run to inspect the code.&amp;nbsp; I looked into all the inherited classes but didn't find a connect method.&amp;nbsp; Using the inspect module it looks like it my be written in C and maybe thats why I can't see the code.&amp;nbsp; How did you find out the exact syntax to use?&lt;/P&gt;&lt;P&gt;I'm using this code in ipython to test&lt;/P&gt;&lt;PRE&gt;from genie import testbed
tb = testbed.load(".\testbed.yaml")
core1 = tb.devices.Core1
core1.connect()&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jan 2022 15:33:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535801#M650</guid>
      <dc:creator>jmattbullen</dc:creator>
      <dc:date>2022-01-21T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535819#M651</link>
      <description>&lt;P&gt;nevermind, I completely missed the post where you got that straight from a dev&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 15:54:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535819#M651</guid>
      <dc:creator>jmattbullen</dc:creator>
      <dc:date>2022-01-21T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535899#M652</link>
      <description>&lt;P&gt;stumbled across the documentation for the connect method.&amp;nbsp; It uses another cisco framework call Unicon.&amp;nbsp; On their docs it lists out the options you can use for pyats&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/docs/unicon/" target="_blank"&gt;https://developer.cisco.com/docs/unicon/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 16:17:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/4535899#M652</guid>
      <dc:creator>jmattbullen</dc:creator>
      <dc:date>2022-01-21T16:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Genie output when using in a script</title>
      <link>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/5103555#M3526</link>
      <description>&lt;P&gt;Here's a direct link to the Unicon device connection arguments.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pubhub.devnetcloud.com/media/unicon/docs/user_guide/connection.html#python-apis" target="_blank"&gt;https://pubhub.devnetcloud.com/media/unicon/docs/user_guide/connection.html#python-apis&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 13:09:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/suppress-genie-output-when-using-in-a-script/m-p/5103555#M3526</guid>
      <dc:creator>mjbear257</dc:creator>
      <dc:date>2024-05-13T13:09:05Z</dc:date>
    </item>
  </channel>
</rss>

