Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

create_database from CloudDB could silence some errors #465

Closed
YiuRULE opened this issue Apr 20, 2020 · 3 comments
Closed

create_database from CloudDB could silence some errors #465

YiuRULE opened this issue Apr 20, 2020 · 3 comments

Comments

@YiuRULE
Copy link

YiuRULE commented Apr 20, 2020

Please read these guidelines before opening an issue.

Bug Description

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

We should start at first a couchdb instance, with an foo user, and bar as password for an admin user,

import cloudant

client = cloudant.client.CouchDB(
            None,
            None,
            admin_party=False,
            url="http://localhost",
            connect=True
)
client.create_database("my_database")

2. What you expected to happen

create_database should launch an error than the current user doesn't have a write access. As we have with the create method for the CloudantDatabase class.

import cloudant
client = cloudant.client.CouchDB(
            None,
            None,
            admin_party=False,
            url="http://localhost",
            connect=True
)
cloudant.database.CloudantDatabase(client name).create(throw_on_exists=False)

will return this exception

cloudant.error.CloudantDatabaseException: Unauthorized to create database http://localhost:5984/my_database

3. What actually happened

It will never launch an exception and will consider the database creation as successful, while the database would never be created.

Environment details

  • Version(s) that are affected by this issue.

    2.13.0

  • Python version

    3.7.5

@bessbd
Copy link
Contributor

bessbd commented Apr 20, 2020

Hi @YiuRULE ,

Thank you for this ticket!
According to the "environment details" section of the issue description, you are using "2.13.0".
However, #447 is supposed to fix this issue which was included with 2.13.0. (FWIW, 2.13.0 was released 4 days ago - https://github.com/cloudant/python-cloudant/releases/tag/2.13.0 ).

Can you please confirm that the version that's being imported and used is actually the latest? You can do it by adding a line of

print(cloudant.__version__)

right after your import cloudant line.

Thank you,

Donat

@YiuRULE
Copy link
Author

YiuRULE commented Apr 21, 2020

Oh yes, probably messed up a bit with my test on my local environment, it was inded fixed on 2.13.0

I will close the issue, thanks :)

@YiuRULE YiuRULE closed this as completed Apr 21, 2020
@bessbd
Copy link
Contributor

bessbd commented Apr 21, 2020

I'm glad to hear this is solved now! Thanks for reporting the resolution and closing the ticket, @YiuRULE !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants