Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

juju utilities functions documenting wrong return type #558

Open
mert-kirpici opened this issue Aug 19, 2022 · 0 comments
Open

juju utilities functions documenting wrong return type #558

mert-kirpici opened this issue Aug 19, 2022 · 0 comments

Comments

@mert-kirpici
Copy link

mert-kirpici commented Aug 19, 2022

Currently two functions in zaza.utilities.juju are documenting a return type of list however they are returning generators:

  • get_machine_uuids_for_application()
    • zaza/zaza/utilities/juju.py

      Lines 285 to 299 in cf46134

      def get_machine_uuids_for_application(application, model_name=None):
      """Return machine uuids for a given application.
      :param application: Application name
      :type application: string
      :param model_name: Name of model to query.
      :type model_name: str
      :returns: List of machine uuuids for an application
      :rtype: list
      """
      for machine in get_machines_for_application(application,
      model_name=model_name):
      yield get_machine_status(machine, key="instance-id",
      model_name=model_name)
  • get_machines_for_application()
    • zaza/zaza/utilities/juju.py

      Lines 123 to 146 in cf46134

      def get_machines_for_application(application, model_name=None):
      """Return machines for a given application.
      :param application: Application name
      :type application: string
      :param model_name: Name of model to query.
      :type model_name: str
      :returns: List of machines for an application
      :rtype: list
      """
      status = get_application_status(application, model_name=model_name)
      if not status:
      return
      # libjuju juju status no longer has units for subordinate charms
      # Use the application it is subordinate-to to find machines
      if is_subordinate_application(application, model_name=model_name):
      yield from get_machines_for_application(
      status.get("subordinate-to")[0],
      model_name=model_name)
      else:
      for unit in status.get("units").keys():
      yield status.get("units").get(unit).get("machine")
coreycb pushed a commit to coreycb/zaza that referenced this issue Oct 17, 2023
Add support for testing CephFS and ceph-proxy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant