Forum Discussion

BlurredVision_1's avatar
BlurredVision_1
Icon for Nimbostratus rankNimbostratus
Jan 05, 2009

PyControl driving me round the bend!!

All,

Disclaimer first - I am an iControl n00b. Total hours messing with iControl is ~8.

Status: ran through the pyControl setup doc but did the Mac OSX equivalents to get it up and running.

Tried to use the sample apps, which have run once or twice, but refuse now to run, with no change that I am aware of having taken place between the run that worked, and the run that did not. obviously I have modified the section of the system_quick_audit.py script to make sure my bigip's IP/username/password combo is set.

Current status:

 
 0 ~/python/pycontrol/samples $ python system_quick_audit.py 
 Loading WSDL: System.Syst`emInfo.wsdl 
 Traceback (most recent call last): 
   File "system_quick_audit.py", line 70, in  
     wsdl_files = ['System.Syst`emInfo']) 
   File "/Library/Python/2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/pyControl.py", line 195, in __init__ 
     self._buildServices() 
   File "/Library/Python/2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/pyControl.py", line 223, in _buildServices 
     setattr(self,attribute_name,Service(name=w, bigip=self, tracefile=self.tracefile)) 
   File "/Library/Python/2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/pyControl.py", line 87, in __init__ 
     cachedir  = self.bigip_cache_dir_stubs, 
   File "/Library/Python/2.5/site-packages/ZSI-2.1_a1-py2.5.egg/ZSI/ServiceProxy.py", line 60, in __init__ 
   File "/Library/Python/2.5/site-packages/ZSI-2.1_a1-py2.5.egg/ZSI/wstools/WSDLTools.py", line 39, in loadFromURL 
   File "/Library/Python/2.5/site-packages/ZSI-2.1_a1-py2.5.egg/ZSI/wstools/Utility.py", line 642, in loadFromURL 
   File "/Library/Python/2.5/site-packages/ZSI-2.1_a1-py2.5.egg/ZSI/wstools/Utility.py", line 153, in urlopen 
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 82, in urlopen 
     return opener.open(url) 
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 190, in open 
     return getattr(self, name)(url) 
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 459, in open_file 
     return self.open_local_file(url) 
   File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.py", line 473, in open_local_file 
     raise IOError(e.errno, e.strerror, e.filename) 
 IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/BIGIP_WSDL_CACHE_DIR/wsdl/System.Syst`emInfo.wsdl' 
 

4 Replies

  • Based the exception being thrown, looks like the path/file changed or something related that caused the script to not be able to find the wsdl.

     

     

    IOError: [Errno 2] No such file or directory: '/Library/Python/2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/BIGIP_WSDL_CACHE_DIR/wsdl/System.Syst`emInfo.wsdl'
  • hmm.. is there a way to instruct pyControl to ignore it's cache? I assume the WSDL is exposed on the BigIP? (showing my ignorance here I am sure...)
  • Odd. It may be worth poking around a bit more to see if there's not a path issue. Could you print out your sys.path and compare it to your WSDL_CACHE dir?

    Here's an example:

     
      In: import sys   
      In: sys.path   
      Out:   
       ['',   
        '/usr/bin',   
        '/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg',   
        '/usr/lib/python2.5/site-packages/ipython-0.9.1-py2.5.egg',   
        '/usr/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg',   
        '/usr/lib/python2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg',   
        '/usr/lib/python2.5/site-packages/ZSI-2.1_a1-py2.5.egg',   
        '/usr/lib/python25.zip',   
        '/usr/lib/python2.5',   
        '/usr/lib/python2.5/plat-linux2',   
        '/usr/lib/python2.5/lib-tk',   
        '/usr/lib/python2.5/lib-dynload',   
        '/usr/local/lib/python2.5/site-packages',   
        '/usr/lib/python2.5/site-packages',   
        '/var/lib/python-support/python2.5',   
        '/usr/lib/python2.5/site-packages/ipython-0.9.1-py2.5.egg/IPython/Extensions']   
          
       In: import pycontrol.pyControl as pc   
        
       In: pc.WSDL_CACHE   
       Out: '/usr/lib/python2.5/site-packages/pyControl-1.3.0_beta-py2.5.egg/pycontrol/BIGIP_WSDL_CACHE_DIR/wsdl'   
        
     

    The WSDL_CACHE attribute should point to the pyControl egg file. This should help you identify what is going on. On my debian system I had fits with path issues across multiple apt-installed python versions, so keep an eye out for something like this as well.

    By the way, this points out a bug that I'll need to fix, and this is a variant of another issue posted to the forums regarding needing elevated perms to write to this directory. It would be nice to be able to set this all up and point it at a $TMP directory on a particular system.

    It should be possible to manually set this attribute but it's not behaving the way I expect when I do this. I'll try and fix this up and submit a new (and overdue) pyControl egg.

    -Matt
  • Upon a closer look, it appears that you may have a typo in the demo script. From a python command prompt, try and simply load the WSDL:

       
       In: b = pc.BIGIP(hostname = '192.168.1.245', username='admin', password='admin', wsdl_files = ['System.SystemInfo'])   
          
       Loading WSDL: System.SystemInfo.wsdl   
          
       In: b.System_SystemInfo.get_version()   
       Out: {'return': 'BIG-IP_v9.4.5'}   
          
       

    HTH,

    -Matt