Skip to content

Error Running Action openstack.server.reboot #29

@ayazali

Description

@ayazali

I am trying to execute the action server.reboot but its producing an error. I think the problem is that it is generating the underlying openstack cli command incorrectly.

Environment
Stackstorm version: st2 3.2.0, on Python 3.6.9
Pack version: openstack 0.8.0
Openstack library version: openstack 5.2.0

Input Parameters
{ "log_level": "DEBUG", "server": "automated_machine_creation_01", "wait": false, "soft": "soft" }

Output
{ "stdout": "", "stderr": "/opt/stackstorm/packs/openstack/actions/src/lib/base.py:84: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.\n command_cls = entry_point.load(require=False)\nst2.actions.python.WrapperAction: DEBUG Generated command \"openstack server reboot automated_machine_creation_01 --soft soft\"\nTraceback (most recent call last):\n File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 333, in <module>\n obj.run()\n File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 192, in run\n output = action.run(**self._parameters)\n File \"/opt/stackstorm/packs/openstack/actions/src/lib/base.py\", line 67, in run\n return self._format_output(out=out, err=err, exit=p.returncode)\n File \"/opt/stackstorm/packs/openstack/actions/src/lib/base.py\", line 96, in _format_output\n sys.stdout.write(out)\nTypeError: write() argument must be str, not bytes\n", "exit_code": 1, "result": "None" }

The input field was SOFT and HARD are strings, while the openstack cli expects only the parameters --soft | --hard without any values. This is how the openstack cli provides the usage for this command. usage: openstack server reboot [-h] [--hard | --soft] [--wait] <server>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions