'Context enter.
.. note::
An implementation shall raise `DiskFileNotOpen` when has not
previously invoked the :func:`swift.obj.diskfile.DiskFile.open`
method.'

def __enter__(self):

    if (self._metadata is None):
        raise DiskFileNotOpen()
    return self
