'Create a folder if it does not exist.
Currently there are two folder that are required on the datastore
- base folder - the folder to store cached images
- temp folder - the folder used for snapshot management and
image uploading
This method is aimed to be used for the management of those
folders to ensure that they are created if they are missing.
The ds_util method mkdir will be used to check if the folder
exists. If this throws and exception \'FileAlreadyExistsException\'
then the folder already exists on the datastore.'

def _create_folder_if_missing(self, ds_name, ds_ref, folder):

    path = ds_obj.DatastorePath(ds_name, folder)
    dc_info = self.get_datacenter_ref_and_name(ds_ref)
    try:
        ds_util.mkdir(self._session, path, dc_info.ref)
        LOG.debug('Folder    %s    created.', path)
    except vexc.FileAlreadyExistsException:
        pass
