Skip to content

slcli vs list throws error, when --column : action is added. #744

@nimmoadam

Description

@nimmoadam

When trying to list VSs for a SL user account, slcli vs list is an option.
To add more columns to the default view, we can use cli like
slcli vs list --columns hostname,primary_ip,datacenter,action,power_state,created_by,action

By doing so, VSs are not listing, am seeing the following exception.

An unexpected error has occured:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/core.py", line 163, in main
    cli.main(**kwargs)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/Library/Python/2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/virt/list.py", line 89, in cli
    env.fout(table)
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/environment.py", line 56, in fout
    self.out(self.fmt(output), newline=newline)
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/environment.py", line 51, in fmt
    return formatting.format_output(output, fmt=self.format)
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/formatting.py", line 37, in format_output
    return str(format_prettytable(data))
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/formatting.py", line 78, in format_prettytable
    ptable = table.prettytable()
  File "/Library/Python/2.7/site-packages/SoftLayer-5.0.1-py2.7.egg/SoftLayer/CLI/formatting.py", line 278, in prettytable
    table = prettytable.PrettyTable(self.columns)
  File "build/bdist.macosx-10.11-intel/egg/prettytable.py", line 122, in __init__
    self.field_names = field_names
  File "build/bdist.macosx-10.11-intel/egg/prettytable.py", line 412, in _set_field_names
    self._validate_option("field_names", val)
  File "build/bdist.macosx-10.11-intel/egg/prettytable.py", line 258, in _validate_option
    self._validate_field_names(val)
  File "build/bdist.macosx-10.11-intel/egg/prettytable.py", line 302, in _validate_field_names
    raise Exception("Field names must be unique!")
Exception: Field names must be unique!

This happens only when action column is added. Otherwise no exceptions, all the columns are listing properly.

Expected Behavior

List all virtual servers, if action column is added.

Actual Behavior

When action column is added to VS list, only exceptions are thrown.

Environment Information

Operating System: OS X - 10.x version
softlayer-python version (slcli --version):
slcli --version
slcli (SoftLayer Command-line), version 5.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions