Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

AttributeError in list pools command #331

Open
barborico opened this issue Dec 17, 2019 · 3 comments
Open

AttributeError in list pools command #331

barborico opened this issue Dec 17, 2019 · 3 comments
Assignees
Labels

Comments

@barborico
Copy link

Problem Description

When using the shipyard list pools command, I have been receiving the following error:

Traceback (most recent call last):
  File "/opt/batch-shipyard/shipyard.py", line 3134, in <module>
    cli()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/batch-shipyard/shipyard.py", line 1571, in pool_list
    convoy.fleet.action_pool_list(ctx.batch_client, ctx.config)
  File "/opt/batch-shipyard/convoy/fleet.py", line 3387, in action_pool_list
    batch.list_pools(batch_client, config)
  File "/opt/batch-shipyard/convoy/batch.py", line 1286, in list_pools
    de.append('      * {}: {}'.format(de.name, de.value))
AttributeError: 'NameValuePair' object has no attribute 'append'

Looking at the source code, I see:

def list_pools(batch_client, config):
    # type: (azure.batch.batch_service_client.BatchServiceClient,
    #        config) -> None
    """List pools
    :param batch_client: The batch client to use.
    :type batch_client: `azure.batch.batch_service_client.BatchServiceClient`
    :param dict config: configuration dict
    """
    if settings.raw(config):
        util.print_raw_paged_output(batch_client.pool.list)
        return
    i = 0
    log = ['list of pools']
    pools = batch_client.pool.list()
    for pool in pools:
        if util.is_not_empty(pool.resize_errors):
            errors = ['  * resize errors:']
            for err in pool.resize_errors:
                errors.append('    * {}: {}'.format(err.code, err.message))
                if util.is_not_empty(err.values):
                    for de in err.values:
                        de.append('      * {}: {}'.format(de.name, de.value))

I believe that the last line has a typo and is intended to read errors.append(...).

Batch Shipyard Version

I am running 3.8.2, but the issue appears to exist in the current master branch as well.

Steps to Reproduce

Expected Results

Actual Results

Redacted Configuration

Additional Logs

Additonal Comments

alfpark added a commit that referenced this issue Jan 6, 2020
@alfpark alfpark self-assigned this Jan 6, 2020
@alfpark alfpark added the defect label Jan 6, 2020
@alfpark
Copy link
Collaborator

alfpark commented Jan 6, 2020

Thanks for the bug report, this will be fixed in the next release.

@barborico
Copy link
Author

barborico commented Feb 5, 2020

Is there an ETA for that release?

@alfpark
Copy link
Collaborator

alfpark commented Feb 7, 2020

Sorry for the delay. I'm waiting on a some service-side support for the next release. Hopefully that will happen within the next few weeks. In the meantime, if you have installed via the script, you can switch your branch to develop, git pull, and re-run your install script to get the changes. Alternatively, you can use the develop-cli docker image.

alfpark added a commit that referenced this issue Mar 20, 2023
alfpark added a commit that referenced this issue Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants