diff --git a/actions/create_linked_resource_url.py b/actions/create_linked_resource_url.py index e68b5a9..6c5d0ae 100644 --- a/actions/create_linked_resource_url.py +++ b/actions/create_linked_resource_url.py @@ -1,6 +1,4 @@ -from azure.mgmt.resource.resources import ( - ResourceManagementClient, - ResourceManagementClientConfiguration) +from azure.mgmt.resource.resources import ResourceManagementClient from azure.mgmt.resource.resources.models import Deployment from azure.mgmt.resource.resources.models import DeploymentProperties from azure.mgmt.resource.resources.models import DeploymentMode @@ -15,9 +13,8 @@ def run(self, subscription_id, deployment_name, group_name, template_uri, parameters_uri): credentials = self.credentials resource_client = ResourceManagementClient( - ResourceManagementClientConfiguration( - credentials, - subscription_id)) + credentials, subscription_id + ) template = TemplateLink( uri=template_uri, ) diff --git a/actions/create_resource.py b/actions/create_resource.py index 3acd40e..dd449aa 100644 --- a/actions/create_resource.py +++ b/actions/create_resource.py @@ -1,6 +1,4 @@ -from azure.mgmt.resource.resources import ( - ResourceManagementClient, - ResourceManagementClientConfiguration) +from azure.mgmt.resource.resources import ResourceManagementClient from azure.mgmt.resource.resources.models import GenericResource from lib.base import AzureBaseResourceManagerAction @@ -13,9 +11,8 @@ def run(self, subscription_id, group_name, resource_name, credentials = self.credentials resource_client = ResourceManagementClient( - ResourceManagementClientConfiguration( - credentials, - subscription_id)) + credentials, subscription_id + ) result = resource_client.resources.create_or_update( group_name, diff --git a/actions/list_resource_groups.py b/actions/list_resource_groups.py index 7da4b76..c8b4c00 100644 --- a/actions/list_resource_groups.py +++ b/actions/list_resource_groups.py @@ -1,6 +1,4 @@ -from azure.mgmt.resource.resources import ( - ResourceManagementClient, - ResourceManagementClientConfiguration) +from azure.mgmt.resource.resources import ResourceManagementClient from lib.base import AzureBaseResourceManagerAction @@ -9,9 +7,8 @@ def run(self, subscription_id): credentials = self.credentials resource_client = ResourceManagementClient( - ResourceManagementClientConfiguration( - credentials, - subscription_id)) + credentials, subscription_id + ) resource_groups = resource_client.resource_groups.list() return [group.name for group in resource_groups] diff --git a/requirements.txt b/requirements.txt index fd87645..93956fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,10 @@ azurerm==0.8.27 -azure-mgmt==0.30.0a1 msrestazure -azure<5.0 -apache-libcloud<3.0.0 + +# azure and azure-mgmt bundles deprecated +# so we list just the packages we need +azure-mgmt-resource +azure-graphrbac + +# pip cannot proces earlier libcloud +apache-libcloud>=1.0.0,<3.0.0