We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77828df commit ad7cf32Copy full SHA for ad7cf32
citc/aws.py
@@ -69,7 +69,7 @@ def from_response(cls: Type["AwsNode"], response) -> "AwsNode":
69
70
ip = response["PrivateIpAddress"]
71
72
- return cls(name=name, state=node_state, ip=ip)
+ return cls(name=name, state=node_state, ip=ip, id=response["InstanceId"])
73
74
@classmethod
75
def all(cls, client: EC2Client, nodespace: dict):
citc/cloud.py
@@ -36,11 +36,13 @@ class CloudNode(ABC):
36
name: str
37
state: NodeState
38
ip: str
39
+ id: str
40
- def __init__(self, name, state, ip):
41
+ def __init__(self, name, state, ip, id):
42
self.name = name
43
self.state = state
44
self.ip = ip
45
+ self.id = id
46
47
48
@abstractmethod
citc/google.py
@@ -76,7 +76,7 @@ def from_response(cls: Type["GoogleNode"], response) -> "GoogleNode":
76
77
ip = response["networkInterfaces"][0]["networkIP"]
78
79
+ return cls(name=name, state=node_state, ip=ip, id=response["id"])
80
81
82
def all(cls, client, nodespace: dict):
citc/oracle.py
@@ -64,7 +64,7 @@ def from_response(
64
)
65
ip = virtual_network_client.get_vnic(vnic_id).data.private_ip
66
67
+ return cls(name=name, state=node_state, ip=ip, id=node_id)
68
def all(cls, config, nodespace: dict):
pyproject.toml
@@ -23,7 +23,7 @@ mypy = "^0.782"
23
flake8 = "^3.7.9"
24
moto = "^1.3.15"
25
coverage = "^5.0.3"
26
-mebula = {version = "^0.2.6", allow-prereleases = true, extras = ["azure", "google", "oracle"]}
+mebula = {version = "^0.2.7", allow-prereleases = true, extras = ["azure", "google", "oracle"]}
27
28
[tool.poetry.scripts]
29
watchdog = 'citc.watchdog:main'
tests/test_list_nodes.py
@@ -11,7 +11,7 @@ def test_create_table():
11
SlurmNode(name="foo-1", state="idle", state_flag=None, features={}, reason=""),
12
SlurmNode(name="foo-2", state="idle", state_flag="~", features={}, reason=""),
13
]
14
- cloud_nodes = [AwsNode(name="foo-1", state=NodeState.RUNNING, ip="10.0.0.25")]
+ cloud_nodes = [AwsNode(name="foo-1", state=NodeState.RUNNING, ip="10.0.0.25", id="i-foobar")]
15
table, headers = create_table(slurm_nodes, cloud_nodes)
16
assert table == [
17
["foo-1", "idle", "", NodeState.RUNNING],
@@ -24,6 +24,6 @@ def test_print_table():
slurm_nodes = [
SlurmNode(name="foo-1", state="idle", state_flag=None, features={}, reason="")
table_data = create_table(slurm_nodes, cloud_nodes)
print(tabulate(table_data))
tests/test_watchdog.py
@@ -17,7 +17,7 @@ def test_crosscheck_one_match():
18
19
20
21
22
res = crosscheck(slurm_nodes, cloud_nodes)
res = list(res)
0 commit comments