'>>> driver = DummyStorageDriver(\'key\', \'secret\')
>>> container_name = \'test container 1\'
>>> container = driver.create_container(container_name=container_name)
>>> container.upload_object(file_path=\'/tmp/inexistent.file\',
...     object_name=\'test\') #doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
LibcloudError:
>>> file_path = path = os.path.abspath(__file__)
>>> file_size = os.path.getsize(file_path)
>>> obj = container.upload_object(file_path=file_path,
...                               object_name=\'test\')
>>> obj #doctest: +ELLIPSIS
<Object: name=test, size=...>
>>> obj.size == file_size
True
@inherits: :class:`StorageDriver.upload_object`
:param file_hash: File hash
:type file_hash: ``str``'

def upload_object(self, file_path, container, object_name, extra=None, file_hash=None):

    if (not os.path.exists(file_path)):
        raise LibcloudError(value=('File    %s    does    not    exist' % file_path), driver=self)
    size = os.path.getsize(file_path)
    return self._add_object(container=container, object_name=object_name, size=size, extra=extra)
