A couple potential bugs in the Azure code.

I was running SonarCloud against a fork my org keeps of this repo, and it found a few potential issues.

Parameters being initialized with mutable objects:

  • src/debian_cloud_images/cli/cleanup.py, line 55 (in def __init__): releases=[]
  • src/debian_cloud_images/cli/cleanup_azure_cloudpartner.py, line 58 (in def __init__): offer_ids=[]
  • src/debian_cloud_images/images/publicinfo.py, line 72 (in def __init__): override_info={}

In src/debian_cloud_images/cli/cleanup_azure_cloudpartner.py, line 133 (in def storage_obj), SonarCloud found that self.__storage is an unused variable:

ret = self.__storage = storage_driver.get_storage(

It looks from context that this should be, so that this method is a memoized accessor:

ret = self.__storage_obj = storage_driver.get_storage(

Finally -- and not nearly as important -- in src/debian_cloud_images/utils/argparse_ext.py, in class ActionEnv's def __init__, there's a param named help. That shadows a built-in Python function. Of course that function is only really needed in the REPL so it's not of much practical consideration but I figured I'd mention it while I was here.