# Buggy code
def __init__(self):
    # Core options
    self.workflowID = None
    """This attribute uniquely identifies the job store and therefore the workflow. It is
        necessary in order to distinguish between two consequitive workflows for which
        self.jobStore is the same, e.g. when a job store name is reused after a previous run has
        finished sucessfully and its job store has been clean up."""
    self.workflowAttemptNumber = 0
    self.jobStore = os.path.abspath("./toil")
    self.logLevel = getLogLevelString()
    self.workDir = None
    self.stats = False

    # Because the stats option needs the jobStore to persist past the end of the run,
    # the clean default value depends the specified stats option and is determined in setOptions
    self.clean = None
    self.cleanWorkDir = None

    # Restarting the workflow options
    self.restart = False

    # Batch system options
    self.batchSystem = "singleMachine"
    self.scale = 1
    self.mesosMasterAddress = "localhost:5050"
    self.parasolCommand = "parasol"
    self.parasolMaxBatches = 10000
    self.environment = {}

    # Autoscaling options
    self.provisioner = None
    self.preemptableNodeType = None
    self.preemptableNodeOptions = None
    self.preemptableBidPrice = None
    self.minPreemptableNodes = 0
    self.maxPreemptableNodes = 10
    self.nodeType = None
    self.nodeOptions = None
    self.minNodes = 0
    self.maxNodes = 10
    self.alphaPacking = 0.8
    self.betaInertia = 1.2
    self.scaleInterval = 360

    # Resource requirements
    self.defaultMemory = 2147483648
    self.defaultCores = 1
    self.defaultDisk = 2147483648
    self.readGlobalFileMutableByDefault = False
    self.defaultPreemptable = False
    self.maxCores = sys.maxint
    self.maxMemory = sys.maxint
    self.maxDisk = sys.maxint

    # Retrying/rescuing jobs
    self.retryCount = 0
    self.maxJobDuration = sys.maxint
    self.rescueJobsFrequency = 3600

    # Misc
    self.maxLogFileSize = 50120
    self.sseKey = None
    self.cseKey = None
    self.servicePollingInterval = 60
    self.useAsync = True

    # Debug options
    self.badWorker = 0.0
    self.badWorkerFailInterval = 0.01


# Traceback (toil.jobStores.abstractJobStore.NoSuchFileException)
cmarkello@c1master1:~$ toil clean azure:hgvm:hgvmevaljobstore
2016-05-13 23:08:36,438 INFO:toil.lib.bioio: Logging set at level: INFO
2016-05-13 23:08:36,445 INFO:toil.utils.toilClean: Parsed arguments
2016-05-13 23:08:36,445 INFO:toil.utils.toilClean: Checking if we have files for toil
2016-05-13 23:08:36,525 INFO:requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): hgvm.table.core.windows.net
2016-05-13 23:08:36,724 INFO:requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): hgvm.blob.core.windows.net
Traceback (most recent call last):
File "/usr/local/bin/toil", line 9, in <module>
load_entry_point('toil==3.2.0a2', 'console_scripts', 'toil')()
File "/usr/local/lib/python2.7/dist-packages/toil/utils/toilMain.py", line 30, in main
module.main()
File "/usr/local/lib/python2.7/dist-packages/toil/utils/toilClean.py", line 53, in main
jobStore = Toil.loadOrCreateJobStore(options.jobStore)
File "/usr/local/lib/python2.7/dist-packages/toil/common.py", line 589, in loadOrCreateJobStore
return AzureJobStore(account, namePrefix, config=config)
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 120, in __init__
super(AzureJobStore, self).__init__(config=config)
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/abstractJobStore.py", line 141, in __init__
with self.readSharedFileStream("config.pickle") as fileHandle:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 318, in readSharedFileStream
raise NoSuchFileException(sharedFileID)
toil.jobStores.abstractJobStore.NoSuchFileException: File 'a77581f6_ad82_5142_acb7_5a6b01eab3fb' does not exist

# Fixed code
def __init__(self):
    # Core options
    self.workflowID = None
    """This attribute uniquely identifies the job store and therefore the workflow. It is
        necessary in order to distinguish between two consequitive workflows for which
        self.jobStore is the same, e.g. when a job store name is reused after a previous run has
        finished sucessfully and its job store has been clean up."""
    self.workflowAttemptNumber = None
    self.jobStore = os.path.abspath("./toil")
    self.logLevel = getLogLevelString()
    self.workDir = None
    self.stats = False

    # Because the stats option needs the jobStore to persist past the end of the run,
    # the clean default value depends the specified stats option and is determined in setOptions
    self.clean = None
    self.cleanWorkDir = None

    # Restarting the workflow options
    self.restart = False

    # Batch system options
    self.batchSystem = "singleMachine"
    self.scale = 1
    self.mesosMasterAddress = "localhost:5050"
    self.parasolCommand = "parasol"
    self.parasolMaxBatches = 10000
    self.environment = {}

    # Autoscaling options
    self.provisioner = None
    self.preemptableNodeType = None
    self.preemptableNodeOptions = None
    self.preemptableBidPrice = None
    self.minPreemptableNodes = 0
    self.maxPreemptableNodes = 10
    self.nodeType = None
    self.nodeOptions = None
    self.minNodes = 0
    self.maxNodes = 10
    self.alphaPacking = 0.8
    self.betaInertia = 1.2
    self.scaleInterval = 360

    # Resource requirements
    self.defaultMemory = 2147483648
    self.defaultCores = 1
    self.defaultDisk = 2147483648
    self.readGlobalFileMutableByDefault = False
    self.defaultPreemptable = False
    self.maxCores = sys.maxint
    self.maxMemory = sys.maxint
    self.maxDisk = sys.maxint

    # Retrying/rescuing jobs
    self.retryCount = 0
    self.maxJobDuration = sys.maxint
    self.rescueJobsFrequency = 3600

    # Misc
    self.maxLogFileSize = 50120
    self.sseKey = None
    self.cseKey = None
    self.servicePollingInterval = 60
    self.useAsync = True

    # Debug options
    self.badWorker = 0.0
    self.badWorkerFailInterval = 0.01