# Buggy code
def _importFile(self, otherCls, url, sharedFileName=None):
    """
    Import the file at the given URL using the given job store class to retrieve that file.
    See also :meth:`importFile`. This method applies a generic approach to importing: it asks
    the other job store class for a stream and writes that stream as eiher a regular or a
    shared file.

    :param AbstractJobStore  otherCls: The concrete subclass of AbstractJobStore that supports
           reading from the given URL.

    :param urlparse.ParseResult url: The location of the file to import.

    :param str sharedFileName: Optional name to assign to the imported file within the job store

    :return The jobStoreFileId of imported file or None if sharedFileName was given
    :rtype: str|None
    """
    if sharedFileName is None:
        with self.writeFileStream() as (writable, jobStoreFileID):
            otherCls._readFromUrl(url, writable)
            return jobStoreFileID
    else:
        self._requireValidSharedFileName(sharedFileName)
        with self.writeSharedFileStream(sharedFileName) as writable:
            otherCls._readFromUrl(url, writable)
            return None


# 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 _importFile(self, otherCls, url, sharedFileName=None):
    """
    Import the file at the given URL using the given job store class to retrieve that file.
    See also :meth:`.importFile`. This method applies a generic approach to importing: it
    asks the other job store class for a stream and writes that stream as eiher a regular or
    a shared file.

    :param AbstractJobStore  otherCls: The concrete subclass of AbstractJobStore that supports
           reading from the given URL.

    :param urlparse.ParseResult url: The location of the file to import.

    :param str sharedFileName: Optional name to assign to the imported file within the job store

    :return The jobStoreFileId of imported file or None if sharedFileName was given
    :rtype: str|None
    """
    if sharedFileName is None:
        with self.writeFileStream() as (writable, jobStoreFileID):
            otherCls._readFromUrl(url, writable)
            return jobStoreFileID
    else:
        self._requireValidSharedFileName(sharedFileName)
        with self.writeSharedFileStream(sharedFileName) as writable:
            otherCls._readFromUrl(url, writable)
            return None