Skip to content

Commit

Permalink
Support for azure-mgmt-recoveryservicesbackup v4.0+ (#1469)
Browse files Browse the repository at this point in the history
In newer versions of the library, the models module got split between
two sub-packages, `passivestamp` and `activestamp`. All models used are
part of the `activestamp` module, so conditionally import from there if
the newer version is installed.
  • Loading branch information
jeremycline authored Feb 29, 2024
1 parent c9bbbd9 commit c0a2cbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ def default_api_version(self):
from azure.mgmt.iothub import models as IoTHubModels
from azure.mgmt.resource.locks import ManagementLockClient
from azure.mgmt.recoveryservicesbackup import RecoveryServicesBackupClient
import azure.mgmt.recoveryservicesbackup.models as RecoveryServicesBackupModels
try:
# Older versions of the library exposed the modules at the root of the package
import azure.mgmt.recoveryservicesbackup.models as RecoveryServicesBackupModels
except ImportError:
import azure.mgmt.recoveryservicesbackup.activestamp.models as RecoveryServicesBackupModels
from azure.mgmt.search import SearchManagementClient
from azure.mgmt.datalake.store import DataLakeStoreAccountManagementClient
import azure.mgmt.datalake.store.models as DataLakeStoreAccountModel
Expand Down

0 comments on commit c0a2cbc

Please sign in to comment.