mirror of
https://github.com/vale981/ray
synced 2025-03-08 19:41:38 -05:00
[Autoscaler][Azure] check if 'update' is available in (#14787)
This commit is contained in:
parent
cd89f0dc55
commit
857408874c
1 changed files with 11 additions and 4 deletions
|
@ -223,10 +223,17 @@ class AzureNodeProvider(NodeProvider):
|
||||||
"""Sets the tag values (string dict) for the specified node."""
|
"""Sets the tag values (string dict) for the specified node."""
|
||||||
node_tags = self._get_cached_node(node_id)["tags"]
|
node_tags = self._get_cached_node(node_id)["tags"]
|
||||||
node_tags.update(tags)
|
node_tags.update(tags)
|
||||||
self.compute_client.virtual_machines.update(
|
if hasattr(self.compute_client.virtual_machines, "update"):
|
||||||
resource_group_name=self.provider_config["resource_group"],
|
self.compute_client.virtual_machines.update(
|
||||||
vm_name=node_id,
|
resource_group_name=self.provider_config["resource_group"],
|
||||||
parameters={"tags": node_tags})
|
vm_name=node_id,
|
||||||
|
parameters={"tags": node_tags})
|
||||||
|
else:
|
||||||
|
# Newer versions of the client use begin_update, not update
|
||||||
|
self.compute_client.virtual_machines.begin_update(
|
||||||
|
resource_group_name=self.provider_config["resource_group"],
|
||||||
|
vm_name=node_id,
|
||||||
|
parameters={"tags": node_tags})
|
||||||
self.cached_nodes[node_id]["tags"] = node_tags
|
self.cached_nodes[node_id]["tags"] = node_tags
|
||||||
|
|
||||||
def terminate_node(self, node_id):
|
def terminate_node(self, node_id):
|
||||||
|
|
Loading…
Add table
Reference in a new issue