Skip to content

list host profile throws KeyError exception on hosts with no node attribute #182

Open
@bsanders

Description

@bsanders

Create an appliance with no 'node' parameter set. Create a host of that appliance type, and try to list its profile. Kaboom.

list host profile/xml should probably catch this exception and bail out.

# stack add appliance foo
# stack add host foobar box=default appliance=foo rack=0 rank=33
# stack list host attr foobar | grep node
# stack list host profile foobar
  File "/opt/stack/bin/stack", line 245, in run_command
    rc = command.runWrapper(name, args[i:])
  File "/opt/stack/lib/python2.6/site-packages/stack/commands/command.py", line 2304, in runWrapper
    rc = self.run(self._params, self._args)
  File "/opt/stack/lib/python2.6/site-packages/stack/commands/list/host/profile/__init__.py", line 212, in run
    xmlinput = self.command('list.host.xml', [ host ])
  File "/opt/stack/lib/python2.6/site-packages/stack/commands/command.py", line 1728, in command
    self.rc = o.runWrapper(name, args, self.level + 1)
  File "/opt/stack/lib/python2.6/site-packages/stack/commands/command.py", line 2304, in runWrapper
    rc = self.run(self._params, self._args)
  File "/opt/stack/lib/python2.6/site-packages/stack/commands/list/host/xml/__init__.py", line 136, in run
    args = [ attrs['node'] ]
stack.commands.list.host.profile: KeyError -- 'node'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions