-
Notifications
You must be signed in to change notification settings - Fork 15
[DPE-5371]: Storage reuse on a different cluster #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6/edge
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ class NotReadyError(PyMongoError): | |
|
|
||
| # Increment this PATCH version before using `charmcraft publish-lib` or reset | ||
| # to 0 if you are raising the major API version | ||
| LIBPATCH = 1 | ||
| LIBPATCH = 2 | ||
|
|
||
| ADMIN_AUTH_SOURCE = "authSource=admin" | ||
| SYSTEM_DBS = ("admin", "local", "config") | ||
|
|
@@ -270,6 +270,11 @@ def get_users(self) -> Set[str]: | |
| ] | ||
| ) | ||
|
|
||
| def get_all_users(self) -> Set[str]: | ||
| """Get all users, including the three charmed managed users.""" | ||
| users_info = self.client.admin.command("usersInfo") | ||
| return {user_obj["user"] for user_obj in users_info["users"]} | ||
|
|
||
| def get_databases(self) -> Set[str]: | ||
| """Return list of all non-default databases.""" | ||
| databases = self.client.list_database_names() | ||
|
|
@@ -280,3 +285,7 @@ def drop_database(self, database: str): | |
| if database in SYSTEM_DBS: | ||
| return | ||
| self.client.drop_database(database) | ||
|
|
||
| def drop_local_database(self): | ||
| """DANGEROUS: Drops the local database.""" | ||
| self.client.drop_database("local") | ||
|
Comment on lines
+289
to
+291
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something we can calculate / store in app databag to verify whether it is safe to drop the local db? then we could add a guardrail by raising a custom exception
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure. |
||
Uh oh!
There was an error while loading. Please reload this page.