[distribution] Handle missing instance directory when listing and running instance command.
no directory means no available instance.
--- a/cwctl.py Fri Oct 15 11:39:54 2010 +0200
+++ b/cwctl.py Fri Oct 15 11:40:36 2010 +0200
@@ -63,7 +63,10 @@
raise ExecutionError('can\'t kill process %s' % pid)
def list_instances(regdir):
- return sorted(idir for idir in listdir(regdir) if isdir(join(regdir, idir)))
+ if isdir(regdir):
+ return sorted(idir for idir in listdir(regdir) if isdir(join(regdir, idir)))
+ else:
+ return []
def detect_available_modes(templdir):
modes = []