lordmauve / chopsticks

Chopsticks is an orchestration library: it lets you execute Python code on remote hosts over SSH.
https://chopsticks.readthedocs.io/
Apache License 2.0
158 stars 16 forks source link

Failing to instantiate an object causes traceback #37

Closed lordmauve closed 7 years ago

lordmauve commented 7 years ago

If we pass the wrong arguments to a tunnel (in this case a Docker was constructed without passing a name), then a traceback is printed (however the program does not crash).

Exception ignored in: <object repr() failed>
Traceback (most recent call last):
  File "/home/mauve/dev/chopsticks/chopsticks/tunnel.py", line 533, in __del__
    self.close()
  File "/home/mauve/dev/chopsticks/chopsticks/tunnel.py", line 511, in close
    if not self.connected:
AttributeError: 'Docker' object has no attribute 'connected'

We can get around this by setting a class variable connected = False in the relevant base class.

lordmauve commented 7 years ago

Fixed by e67a7dff25d197ef57e7c3ede842e1e3c15f4ac2.