<?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: exsh error inside imported file in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54298#M15467</link>
    <description>I think you need to define a variable that can store the output of the command output, otherwise where does all that output go when it is retrieved?&lt;BR /&gt;
variable = exsh.clicmd(&lt;EXOS_COMMAND&gt;)&lt;/EXOS_COMMAND&gt;</description>
    <pubDate>Sat, 24 Sep 2016 02:31:00 GMT</pubDate>
    <dc:creator>Kawawa</dc:creator>
    <dc:date>2016-09-24T02:31:00Z</dc:date>
    <item>
      <title>exsh error inside imported file</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54296#M15465</link>
      <description>EXOS version 16.1.1.4      I am working on a couple of python scripts.  So far everything is working as planned, however I'm getting an error when I try to create multiple files that can be imported (instead of one big file).  Below I will give 2 example files and the error that I'm getting.       Example   File Name: ImportedFile.py    def showVlan():      exsh.clicmd('show vlan', xml=True)      File Name: main.py    import importedFile    if __name__ == '__main__':        importedFile.showVlan()        Both files are in /usr/local/cfg.  When I run main.py I get the following error:    Slot-1.21 # run script main.py  Traceback (most recent call last):    File "/config/main.py", line 6, in       importedFile.showVlan()    File "/config/importedFile.py", line 4, in showVlan      exsh.clicmd('show vlan', xml=True)  NameError: global name 'exsh' is not defined        Is it not possible to run exsh from an imported file?</description>
      <pubDate>Fri, 23 Sep 2016 21:51:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54296#M15465</guid>
      <dc:creator>bw447</dc:creator>
      <dc:date>2016-09-23T21:51:00Z</dc:date>
    </item>
    <item>
      <title>RE: exsh error inside imported file</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54297#M15466</link>
      <description>You will have to add:&lt;BR /&gt;
import exshto ImportedFile.py&lt;BR /&gt;
&lt;BR /&gt;
exsh is automatically included in the file specified by run script file.py, &lt;BR /&gt;
but must be explicitly imported beyond that. &lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2016 22:17:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54297#M15466</guid>
      <dc:creator>Dave_Hammers</dc:creator>
      <dc:date>2016-09-23T22:17:00Z</dc:date>
    </item>
    <item>
      <title>RE: exsh error inside imported file</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54298#M15467</link>
      <description>I think you need to define a variable that can store the output of the command output, otherwise where does all that output go when it is retrieved?&lt;BR /&gt;
variable = exsh.clicmd(&lt;EXOS_COMMAND&gt;)&lt;/EXOS_COMMAND&gt;</description>
      <pubDate>Sat, 24 Sep 2016 02:31:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54298#M15467</guid>
      <dc:creator>Kawawa</dc:creator>
      <dc:date>2016-09-24T02:31:00Z</dc:date>
    </item>
    <item>
      <title>RE: exsh error inside imported file</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54299#M15468</link>
      <description>&lt;B&gt;@Dave&lt;/B&gt; Hammers    Sorry for the late reply, but the import is what I was missing.  Didn't know it was explicitly imported.</description>
      <pubDate>Thu, 06 Oct 2016 21:00:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/exsh-error-inside-imported-file/m-p/54299#M15468</guid>
      <dc:creator>bw447</dc:creator>
      <dc:date>2016-10-06T21:00:00Z</dc:date>
    </item>
  </channel>
</rss>

