mirror of
https://github.com/vale981/ray
synced 2025-03-06 18:41:40 -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."""
|
||||
node_tags = self._get_cached_node(node_id)["tags"]
|
||||
node_tags.update(tags)
|
||||
self.compute_client.virtual_machines.update(
|
||||
resource_group_name=self.provider_config["resource_group"],
|
||||
vm_name=node_id,
|
||||
parameters={"tags": node_tags})
|
||||
if hasattr(self.compute_client.virtual_machines, "update"):
|
||||
self.compute_client.virtual_machines.update(
|
||||
resource_group_name=self.provider_config["resource_group"],
|
||||
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
|
||||
|
||||
def terminate_node(self, node_id):
|
||||
|
|
Loading…
Add table
Reference in a new issue