azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

New version of NetApp module does not work with get_client_from_json_dict

Open sschols opened this issue 5 years ago • 7 comments

  • Package Name: azure-mgmt-netapp
  • Package Version: 1.0.0
  • Operating System: MacOS 11
  • Python Version: 3.9

Describe the bug Creating a new NetAppManagementClient via the get_client_from_json_dict function of the client factory fails:

  File "/opt/cloud/lnwcloud/operations/azure.py", line 41, in _get_az_client
    client = get_client_from_json_dict(NetAppManagementClient, config_dict)
  File "/opt/cloud/env_linux/lib/python3.9/site-packages/azure/common/client_factory.py", line 171, in get_client_from_json_dict
    return _instantiate_client(client_class, **parameters)
  File "/opt/cloud/env_linux/lib/python3.9/site-packages/azure/common/client_factory.py", line 34, in _instantiate_client
    return client_class(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'credential'

To Reproduce Steps to reproduce the behavior:

  1. Create client config JSON
  2. run get_client_from_json_dict(NetAppManagementClient, client_config_dict)
  3. Watch it fail

Expected behavior A NetApp Management Client should be created

Additional context

There seem to have been many changes with https://github.com/Azure/azure-sdk-for-python/commit/8fae515f3f795548c6bc7c53f2f93478a6e53fdd#diff-e0ab8e5f8b111235d15c2b525ecdf6a9531826e786d90a30c0a34fa1f1f371e4, including renaming of the credentials parameter (https://github.com/Azure/azure-sdk-for-python/commit/8fae515f3f795548c6bc7c53f2f93478a6e53fdd#diff-e0ab8e5f8b111235d15c2b525ecdf6a9531826e786d90a30c0a34fa1f1f371e4R14). The credentials parameter is the one being set by get_client_from_json_dict. This is likely the cause of this

The documentation also seems to not reflect the changes to the azure.mgmt.netapp package yet, there is no information on the NetAppManagementClient in https://docs.microsoft.com/de-de/python/api/azure-mgmt-netapp/azure.mgmt.netapp, it still refers to the AzureNetAppFilesManagementClient implementation.

sschols avatar Feb 16 '21 14:02 sschols

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @appgwsuppgithub.

Issue Details
  • Package Name: azure-mgmt-netapp
  • Package Version: 1.0.0
  • Operating System: MacOS 11
  • Python Version: 3.9

Describe the bug Creating a new NetAppManagementClient via the get_client_from_json_dict function of the client factory fails:

  File "/opt/cloud/lnwcloud/operations/azure.py", line 41, in _get_az_client
    client = get_client_from_json_dict(NetAppManagementClient, config_dict)
  File "/opt/cloud/env_linux/lib/python3.9/site-packages/azure/common/client_factory.py", line 171, in get_client_from_json_dict
    return _instantiate_client(client_class, **parameters)
  File "/opt/cloud/env_linux/lib/python3.9/site-packages/azure/common/client_factory.py", line 34, in _instantiate_client
    return client_class(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'credential'

To Reproduce Steps to reproduce the behavior:

  1. Create client config JSON
  2. run get_client_from_json_dict(NetAppManagementClient, client_config_dict)
  3. Watch it fail

Expected behavior A NetApp Management Client should be created

Additional context

There seem to have been many changes with https://github.com/Azure/azure-sdk-for-python/commit/8fae515f3f795548c6bc7c53f2f93478a6e53fdd#diff-e0ab8e5f8b111235d15c2b525ecdf6a9531826e786d90a30c0a34fa1f1f371e4, including renaming of the credentials parameter (https://github.com/Azure/azure-sdk-for-python/commit/8fae515f3f795548c6bc7c53f2f93478a6e53fdd#diff-e0ab8e5f8b111235d15c2b525ecdf6a9531826e786d90a30c0a34fa1f1f371e4R14). The credentials parameter is the one being set by get_client_from_json_dict. This is likely the cause of this

The documentation also seems to not reflect the changes to the azure.mgmt.netapp package yet, there is no information on the NetAppManagementClient in https://docs.microsoft.com/de-de/python/api/azure-mgmt-netapp/azure.mgmt.netapp, it still refers to the AzureNetAppFilesManagementClient implementation.

Author: sschols
Assignees: -
Labels:

Mgmt, Network - Application Gateway, Service Attention, bug, customer-reported, needs-triage, question

Milestone: -

ghost avatar Feb 16 '21 16:02 ghost

Thanks for the feedback, we’ll investigate asap.

xiangyan99 avatar Feb 16 '21 16:02 xiangyan99

Hi @sschols This is a duplicate of https://github.com/Azure/azure-sdk-for-python/issues/15075

The new generation of SDK do not support this factory.

lmazuel avatar Feb 16 '21 17:02 lmazuel

Thanks @lmazuel for the update. Are there any plans on updating the documentation accordingly? When I install the azure-mgmt-netapp module via pip right now, I get the 1.0 (beta?) version, which is not documented in the official SDK docs yet, which is very confusing.

sschols avatar Feb 16 '21 18:02 sschols

We discussed on our team and concluded we do not want to support the JSON or file factory for security purposes, and we don't want to encourage practices that feel unsecure. We wrote a migration guide for scenario: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/identity/azure-identity/migration_guide.md

Please let me know any feedback or questions related to this.

lmazuel avatar Mar 12 '21 23:03 lmazuel

@sschols if the documentation is still not accurate, would you mind creating another issue about it? I like to keep issues focuses, since otherwise it ends up with many many different people and the success rate of fixes becomes low. Thanks!

lmazuel avatar Mar 12 '21 23:03 lmazuel

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Mar 20 '21 02:03 ghost