Skip to content

Commit 0965212

Browse files
authored
Merge branch 'dev' into feature/TPT-4701-replace-hardcoded-capabilities-with-capability-class
2 parents 7c7f828 + 0a1619f commit 0965212

3 files changed

Lines changed: 27 additions & 14 deletions

File tree

‎linode_api4/objects/monitor.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ class MonitorDashboard(Base):
276276
"id": Property(identifier=True),
277277
"created": Property(is_datetime=True),
278278
"label": Property(),
279-
"service_type": Property(ServiceType),
280-
"type": Property(DashboardType),
279+
"service_type": Property(),
280+
"type": Property(),
281281
"group_by": Property(),
282282
"widgets": Property(json_object=DashboardWidget),
283283
"updated": Property(is_datetime=True),
@@ -294,7 +294,7 @@ class MonitorService(Base):
294294
api_endpoint = "/monitor/services/{service_type}"
295295
id_attribute = "service_type"
296296
properties = {
297-
"service_type": Property(ServiceType),
297+
"service_type": Property(),
298298
"label": Property(),
299299
"alert": Property(json_object=ServiceAlert),
300300
}
@@ -495,7 +495,7 @@ class AlertDefinition(DerivedBase):
495495
"entity_ids": Property(mutable=True),
496496
"description": Property(mutable=True),
497497
"service_class": Property(alias_of="class"),
498-
"scope": Property(AlertScope),
498+
"scope": Property(),
499499
"regions": Property(mutable=True),
500500
"entities": Property(json_object=AlertEntities),
501501
"channel_ids": Property(mutable=True),

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ unit-test = [
4646
]
4747
int-test = [
4848
"linode_api4[test-shared]",
49+
"cryptography",
4950
]
5051
lint = [
5152
"black>=23.1.0",

‎test/integration/conftest.py‎

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import logging
33
import os
44
import random
5-
import subprocess
65
import time
76
from test.integration.helpers import (
87
get_test_label,
@@ -14,6 +13,8 @@
1413

1514
import pytest
1615
import requests
16+
from cryptography.hazmat.primitives import serialization
17+
from cryptography.hazmat.primitives.asymmetric import ed25519
1718
from requests.exceptions import ConnectionError, RequestException
1819

1920
from linode_api4 import (
@@ -273,17 +274,28 @@ def create_linode_for_pass_reset(test_linode_client, e2e_test_firewall):
273274

274275

275276
@pytest.fixture(scope="session")
276-
def ssh_key_gen(tmp_path_factory):
277-
key_path = tmp_path_factory.mktemp("ssh-key-gen") / "sdk-sshkey"
278-
279-
subprocess.run(
280-
["ssh-keygen", "-q", "-t", "rsa", "-f", str(key_path), "-N", ""],
281-
check=True,
277+
def ssh_key_gen():
278+
key = ed25519.Ed25519PrivateKey.generate()
279+
280+
pub_key = (
281+
key.public_key()
282+
.public_bytes(
283+
encoding=serialization.Encoding.OpenSSH,
284+
format=serialization.PublicFormat.OpenSSH,
285+
)
286+
.decode()
287+
.rstrip()
288+
)
289+
priv_key = (
290+
key.private_bytes(
291+
encoding=serialization.Encoding.PEM,
292+
format=serialization.PrivateFormat.OpenSSH,
293+
encryption_algorithm=serialization.NoEncryption(),
294+
)
295+
.decode()
296+
.rstrip()
282297
)
283298

284-
pub_key = key_path.with_suffix(".pub").read_text().rstrip()
285-
priv_key = key_path.read_text().rstrip()
286-
287299
yield pub_key, priv_key
288300

289301

0 commit comments

Comments
 (0)