[StarCluster] 'starcluster help start' causes a crash

Ian Davis ian.davis at grassrootsbio.com
Thu Feb 28 11:14:03 EST 2013


Hi,

I noticed that 'starcluster help start' causes a crash (Python exception), but 'starcluster start -help' does not.  I believe the problem is that the 'help' subcommand object does not fully configure the other subcommand object ('start', in this case) before asking it to print its help info.  Copying a few lines of initialization code from cli.py to help.py seems to fix this.  Please see the bottom of this email for a diff / patch file that fixes the bug (at least on my system, so far).

I just started using StarCluster, and I *love* it.  Thank you so much for creating this.  I was absolutely giddy in describing it to a co-worker this morning, and it's really helping me get my research done quickly and cheaply.  The option to use spot instances as workers is especially brilliant.  I hope this little patch helps out in some small way.

Best,
Ian



Below is (1) the crash log, and (2) the patch to fix it.



---------- CRASH DETAILS ----------
COMMAND: starcluster help start
2013-02-28 10:54:44,162 PID: 12056 config.py:551 - DEBUG - Loading config
2013-02-28 10:54:44,162 PID: 12056 config.py:118 - DEBUG - Loading file: /home/grb/.starcluster/config
2013-02-28 10:54:44,164 PID: 12056 cli.py:287 - DEBUG - Traceback (most recent call last):
  File "/home/grb/starclust/venv/local/lib/python2.7/site-packages/StarCluster-0.93.3-py2.7.egg/starcluster/cli.py", line 255, in main
    sc.execute(args)
  File "/home/grb/starclust/venv/local/lib/python2.7/site-packages/StarCluster-0.93.3-py2.7.egg/starcluster/commands/help.py", line 21, in execute
    sc.addopts(lparser)
  File "/home/grb/starclust/venv/local/lib/python2.7/site-packages/StarCluster-0.93.3-py2.7.egg/starcluster/commands/start.py", line 39, in addopts
    if self.cfg:
  File "/home/grb/starclust/venv/local/lib/python2.7/site-packages/StarCluster-0.93.3-py2.7.egg/starcluster/commands/base.py", line 77, in cfg
    self._cfg = self.goptions_dict.get('CONFIG')
  File "/home/grb/starclust/venv/local/lib/python2.7/site-packages/StarCluster-0.93.3-py2.7.egg/starcluster/commands/base.py", line 46, in goptions_dict
    return dict(self.gopts.__dict__)
AttributeError: 'NoneType' object has no attribute '__dict__'

---------- SYSTEM INFO ----------
StarCluster: 0.93.3
Python: 2.7.2+ (default, Oct  4 2011, 20:06:09)  [GCC 4.6.1]
Platform: Linux-3.0.0-12-generic-x86_64-with-LinuxMint-12-lisa
boto: 2.3.0
ssh: 1.7.13
Crypto: 2.3
jinja2: 2.6
decorator: 3.3.1



--- help.py.orig  2013-02-28 11:03:22.863318498 -0500
+++ help.py        2013-02-28 11:04:13.287884893 -0500
@@ -17,6 +17,10 @@
             try:
                 sc = self.subcmds_map[cmdname]
                 lparser = optparse.OptionParser(sc.__doc__.strip())
+                sc.gopts = self.gopts
+                sc.parser = lparser
+                sc.gparser = self.gparser
+                sc.subcmds_map = self.subcmds_map
                 if hasattr(sc, 'addopts'):
                     sc.addopts(lparser)
                 lparser.print_help()

---
Ian W. Davis, PhD
Head of Computing / Bioinformatics
GrassRoots Biotechnology

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/starcluster/attachments/20130228/b035ccb3/attachment.htm


More information about the StarCluster mailing list