Skip to content

Commit 61b677a

Browse files
Merge branch 'dev' into zhiwei/rm-psss-output
2 parents 45b9fc6 + b51634d commit 61b677a

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

linode_api4/objects/database.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from deprecated import deprecated
2+
13
from linode_api4.objects import Base, DerivedBase, MappedObject, Property
24

35

@@ -63,6 +65,9 @@ def invalidate(self):
6365
Base.invalidate(self)
6466

6567

68+
@deprecated(
69+
reason="Backups are not supported for non-legacy database clusters."
70+
)
6671
class DatabaseBackup(DerivedBase):
6772
"""
6873
A generic Managed Database backup.
@@ -97,6 +102,9 @@ def restore(self):
97102
)
98103

99104

105+
@deprecated(
106+
reason="Backups are not supported for non-legacy database clusters."
107+
)
100108
class MySQLDatabaseBackup(DatabaseBackup):
101109
"""
102110
A backup for an accessible Managed MySQL Database.
@@ -107,6 +115,9 @@ class MySQLDatabaseBackup(DatabaseBackup):
107115
api_endpoint = "/databases/mysql/instances/{database_id}/backups/{id}"
108116

109117

118+
@deprecated(
119+
reason="Backups are not supported for non-legacy database clusters."
120+
)
110121
class PostgreSQLDatabaseBackup(DatabaseBackup):
111122
"""
112123
A backup for an accessible Managed PostgreSQL Database.
@@ -221,6 +232,9 @@ def patch(self):
221232
"{}/patch".format(MySQLDatabase.api_endpoint), model=self
222233
)
223234

235+
@deprecated(
236+
reason="Backups are not supported for non-legacy database clusters."
237+
)
224238
def backup_create(self, label, **kwargs):
225239
"""
226240
Creates a snapshot backup of a Managed MySQL Database.
@@ -358,6 +372,9 @@ def patch(self):
358372
"{}/patch".format(PostgreSQLDatabase.api_endpoint), model=self
359373
)
360374

375+
@deprecated(
376+
reason="Backups are not supported for non-legacy database clusters."
377+
)
361378
def backup_create(self, label, **kwargs):
362379
"""
363380
Creates a snapshot backup of a Managed PostgreSQL Database.

test/integration/models/database/test_database.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_db_fork_status():
130130

131131

132132
@pytest.mark.skipif(
133-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
133+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
134134
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
135135
)
136136
def test_get_types(test_linode_client):
@@ -142,7 +142,7 @@ def test_get_types(test_linode_client):
142142

143143

144144
@pytest.mark.skipif(
145-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
145+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
146146
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
147147
)
148148
def test_get_engines(test_linode_client):
@@ -156,7 +156,7 @@ def test_get_engines(test_linode_client):
156156

157157

158158
@pytest.mark.skipif(
159-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
159+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
160160
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
161161
)
162162
def test_database_instance(test_linode_client, test_create_sql_db):
@@ -167,7 +167,7 @@ def test_database_instance(test_linode_client, test_create_sql_db):
167167

168168
# ------- POSTGRESQL DB Test cases -------
169169
@pytest.mark.skipif(
170-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
170+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
171171
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
172172
)
173173
def test_get_sql_db_instance(test_linode_client, test_create_sql_db):
@@ -185,7 +185,7 @@ def test_get_sql_db_instance(test_linode_client, test_create_sql_db):
185185

186186

187187
@pytest.mark.skipif(
188-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
188+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
189189
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
190190
)
191191
def test_update_sql_db(test_linode_client, test_create_sql_db):
@@ -218,7 +218,7 @@ def test_update_sql_db(test_linode_client, test_create_sql_db):
218218

219219

220220
@pytest.mark.skipif(
221-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
221+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
222222
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
223223
)
224224
def test_get_sql_ssl(test_linode_client, test_create_sql_db):
@@ -228,7 +228,7 @@ def test_get_sql_ssl(test_linode_client, test_create_sql_db):
228228

229229

230230
@pytest.mark.skipif(
231-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
231+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
232232
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
233233
)
234234
def test_sql_patch(test_linode_client, test_create_sql_db):
@@ -260,7 +260,7 @@ def test_sql_patch(test_linode_client, test_create_sql_db):
260260

261261

262262
@pytest.mark.skipif(
263-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
263+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
264264
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
265265
)
266266
def test_get_sql_credentials(test_linode_client, test_create_sql_db):
@@ -271,7 +271,7 @@ def test_get_sql_credentials(test_linode_client, test_create_sql_db):
271271

272272

273273
@pytest.mark.skipif(
274-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
274+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
275275
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
276276
)
277277
def test_reset_sql_credentials(test_linode_client, test_create_sql_db):
@@ -287,7 +287,7 @@ def test_reset_sql_credentials(test_linode_client, test_create_sql_db):
287287

288288
# ------- POSTGRESQL DB Test cases -------
289289
@pytest.mark.skipif(
290-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
290+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
291291
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
292292
)
293293
def test_get_postgres_db_instance(test_linode_client, test_create_postgres_db):
@@ -307,7 +307,7 @@ def test_get_postgres_db_instance(test_linode_client, test_create_postgres_db):
307307

308308

309309
@pytest.mark.skipif(
310-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
310+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
311311
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
312312
)
313313
def test_update_postgres_db(test_linode_client, test_create_postgres_db):
@@ -342,7 +342,7 @@ def test_update_postgres_db(test_linode_client, test_create_postgres_db):
342342

343343

344344
@pytest.mark.skipif(
345-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
345+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
346346
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
347347
)
348348
def test_get_postgres_ssl(test_linode_client, test_create_postgres_db):
@@ -352,7 +352,7 @@ def test_get_postgres_ssl(test_linode_client, test_create_postgres_db):
352352

353353

354354
@pytest.mark.skipif(
355-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
355+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
356356
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
357357
)
358358
def test_postgres_patch(test_linode_client, test_create_postgres_db):
@@ -384,7 +384,7 @@ def test_postgres_patch(test_linode_client, test_create_postgres_db):
384384

385385

386386
@pytest.mark.skipif(
387-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
387+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
388388
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
389389
)
390390
def test_get_postgres_credentials(test_linode_client, test_create_postgres_db):
@@ -395,7 +395,7 @@ def test_get_postgres_credentials(test_linode_client, test_create_postgres_db):
395395

396396

397397
@pytest.mark.skipif(
398-
os.getenv("RUN_DB_TESTS").strip().lower() not in {"yes", "true"},
398+
os.getenv("RUN_DB_TESTS", "").strip().lower() not in {"yes", "true"},
399399
reason="RUN_DB_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
400400
)
401401
def test_reset_postgres_credentials(

0 commit comments

Comments
 (0)