Skip to content

Commit

Permalink
OS-7570. Fixed Azure discovery for intances without sg (#808)
Browse files Browse the repository at this point in the history
## Related issue number

OS-7570

## Checklist

* [x] The pull request title is a good summary of the changes
* [ ] Unit tests for the changes exist
* [ ] New and existing unit tests pass locally
  • Loading branch information
nk-hystax authored May 30, 2024
1 parent f0d1062 commit 61f9a2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/cloud_adapter/clouds/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ def _get_nics_by_instance(self, vm, return_all=True):

def _get_sgs_by_instance(self, vm):
nics = self._get_nics_by_instance(vm, return_all=True)
sgs_ids = set(nic.network_security_group.id for nic in nics)
sgs_ids = set(nic.network_security_group.id for nic in nics
if hasattr(nic.network_security_group, 'id'))
return list(sgs_ids)

def _get_vnet_id_by_instance(self, vm):
Expand Down

0 comments on commit 61f9a2f

Please sign in to comment.