Title: Server creation impossible due to improper handling of repeatable parameters · Issue #37 · StackStorm-Exchange/stackstorm-openstack · GitHub
Open Graph Title: Server creation impossible due to improper handling of repeatable parameters · Issue #37 · StackStorm-Exchange/stackstorm-openstack
X Title: Server creation impossible due to improper handling of repeatable parameters · Issue #37 · StackStorm-Exchange/stackstorm-openstack
Description: Versions used StackStorm version used: st2 3.4.1, on Python 3.6.9 stackstorm-openstackversion used: 1.0.1 Bug description I'm unable to create a server using the "openstack.server.create" action due the improper handling of repeatable pa...
Open Graph Description: Versions used StackStorm version used: st2 3.4.1, on Python 3.6.9 stackstorm-openstackversion used: 1.0.1 Bug description I'm unable to create a server using the "openstack.server.create" action du...
X Description: Versions used StackStorm version used: st2 3.4.1, on Python 3.6.9 stackstorm-openstackversion used: 1.0.1 Bug description I'm unable to create a server using the "openstack.server.create&q...
Opengraph URL: https://github.com/StackStorm-Exchange/stackstorm-openstack/issues/37
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Server creation impossible due to improper handling of repeatable parameters","articleBody":"# Versions used\r\nStackStorm version used: st2 3.4.1, on Python 3.6.9\r\nstackstorm-openstackversion used: 1.0.1\r\n\r\n# Bug description\r\nI'm unable to create a server using the \"openstack.server.create\" action due the improper handling of repeatable parameters.\r\n\r\nFirstly, parameters `network`, `port`, `nic` and `hint` are included in the generated command even if no value is set. Those parameters interact with each other (`network` is a wrapper for `nic`, according to [OpenStack documentation](https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/server.html#server-create)) and by sending all of them independently of user input makes a conflict and the result is not what is expected. (Examples 1 & 2 below)\r\n\r\nThe second problem concerns type conversion of repeatable list parameters like `network`. Indeed, when forcing dummy or null values for `nic`, `hint` and `port`, the given `network` parameter is still incorrectly interpreted during the conversion from ST2 array to Python list to repeated openstack args.\r\n\r\n# Errors output\r\n## Example 1\r\nTrying to create a server with only one NIC on the \"Ext-Net\" network, using the `network` parameter\r\n```\r\n~$ st2 run openstack.server.create flavor=s1-2 server_name=Test network=Ext-Net image=\"Debian 10\"\r\n..\r\nid: 608aa296c25e5f8822520b56\r\naction.ref: openstack.server.create\r\ncontext.user: st2admin\r\nparameters: \r\n flavor: s1-2\r\n image: Debian 10\r\n network:\r\n - Ext-Net\r\n server_name: Test\r\nstatus: failed\r\nstart_timestamp: Thu, 29 Apr 2021 12:12:06 UTC\r\nend_timestamp: Thu, 29 Apr 2021 12:12:10 UTC\r\nresult: \r\n exit_code: 1\r\n result: None\r\n stderr: \"/opt/stackstorm/packs/openstack/actions/src/lib/base.py:84: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.\r\n command_cls = entry_point.load(require=False)\r\nst2.actions.python.WrapperAction: DEBUG Generated command \". /root/openstackrc.sh && openstack server create -f json Test --flavor s1-2 --image 'Debian 10' --network '['\"'\"'Ext-Net'\"'\"']' --port None --nic None --hint '[]'\"\r\nInvalid argument None; argument must be of form 'net-id=net-uuid,port-id=port-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,tag=tag'\r\n\"\r\n stdout: ''\r\n```\r\n\r\n## Example 2\r\nTrying to create a server with only one NIC on the \"Ext-Net\" network, using the `nic` parameter\r\n```\r\n~$ st2 run openstack.server.create flavor=s1-2 server_name=Test nic=\"net-id=393d06cc-a82c-4dc4-a576-c79e8dd67ba3\" image=\"Debian 10\"\r\n..\r\nid: 608aa2d4c25e5f8822520b59\r\naction.ref: openstack.server.create\r\ncontext.user: st2admin\r\nparameters: \r\n flavor: s1-2\r\n image: Debian 10\r\n nic:\r\n - net-id=393d06cc-a82c-4dc4-a576-c79e8dd67ba3\r\n server_name: Test\r\nstatus: failed\r\nstart_timestamp: Thu, 29 Apr 2021 12:13:08 UTC\r\nend_timestamp: Thu, 29 Apr 2021 12:13:11 UTC\r\nresult: \r\n exit_code: 1\r\n result: None\r\n stderr: \"/opt/stackstorm/packs/openstack/actions/src/lib/base.py:84: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.\r\n command_cls = entry_point.load(require=False)\r\nst2.actions.python.WrapperAction: DEBUG Generated command \". /root/openstackrc.sh && openstack server create -f json Test --flavor s1-2 --image 'Debian 10' --network None --port None --nic '['\"'\"'net-id=393d06cc-a82c-4dc4-a576-c79e8dd67ba3'\"'\"']' --hint '[]'\"\r\nInvalid argument ['net-id=393d06cc-a82c-4dc4-a576-c79e8dd67ba3']; argument must be of form 'net-id=net-uuid,port-id=port-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,tag=tag'\r\n\"\r\n stdout: ''\r\n\r\n```\r\n\r\n## Example 3\r\nTrying to create a server with only one NIC on the \"Ext-Net\" network using the `network` parameter while providing dummy or null values for other buggy parameters.\r\n```\r\n~$ st2 run openstack.server.create flavor=s1-2 server_name=Test image=\"Debian 10\" hint='[dummy=value]' port='[]' nic='[]' network='[\"Ext-Net\"]'\r\n..\r\nid: 608aa3e6c25e5f8822520b65\r\naction.ref: openstack.server.create\r\ncontext.user: st2admin\r\nparameters: \r\n flavor: s1-2\r\n hint:\r\n - '[dummy=value]'\r\n image: Debian 10\r\n network:\r\n - Ext-Net\r\n nic: []\r\n port: []\r\n server_name: Test\r\nstatus: failed\r\nstart_timestamp: Thu, 29 Apr 2021 12:17:42 UTC\r\nend_timestamp: Thu, 29 Apr 2021 12:17:46 UTC\r\nresult: \r\n exit_code: 1\r\n result: None\r\n stderr: \"/opt/stackstorm/packs/openstack/actions/src/lib/base.py:84: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately.\r\n command_cls = entry_point.load(require=False)\r\nst2.actions.python.WrapperAction: DEBUG Generated command \". /root/openstackrc.sh && openstack server create -f json Test --flavor s1-2 --image 'Debian 10' --network '['\"'\"'Ext-Net'\"'\"']' --hint '['\"'\"'[dummy=value]'\"'\"']'\"\r\nNo Network found for ['Ext-Net']\r\n\"\r\n stdout: ''\r\n\r\n```\r\n---\r\nI've been trying to fix this bug but I can't understand why those parameters does not work properly for the specific \"openstack.server.create\" action. Any hint on this would be greatly appreciated!\r\nThanks","author":{"url":"https://github.com/teeptoo","@type":"Person","name":"teeptoo"},"datePublished":"2021-04-29T12:25:56Z","url":"https://github.com/StackStorm-Exchange/stackstorm-openstack/issues/37"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:67214a78-0263-e5d8-459a-fb2e1062ff2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8578:1DDB0:52C1F2:717DFF:6B05E25E |
| html-safe-nonce | ed965736cf325cb01a9e435d72cd332ca73a1a816f63dd5f9398e88410459044 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTc4OjFEREIwOjUyQzFGMjo3MTdERkY6NkIwNUUyNUUiLCJ2aXNpdG9yX2lkIjoiNzQ4ODY2MjcyNTIxMjg4OTY5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 543cde2848ba2ef6f115ddf63e80934d6f708a512226e6b16ae38574a7f82372 |
| hovercard-subject-tag | issue:870959910 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/StackStorm-Exchange/stackstorm-openstack/37/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71432777653f7ba9b665ab09deaed76a5ecb68ee201afff0ec0706fae775a62d/StackStorm-Exchange/stackstorm-openstack/issues/37 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71432777653f7ba9b665ab09deaed76a5ecb68ee201afff0ec0706fae775a62d/StackStorm-Exchange/stackstorm-openstack/issues/37 |
| og:image:alt | Versions used StackStorm version used: st2 3.4.1, on Python 3.6.9 stackstorm-openstackversion used: 1.0.1 Bug description I'm unable to create a server using the "openstack.server.create" action du... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | teeptoo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e6b0e6e5a9a8e0ddb968297ede4e2eac72d30ea174a0970eb8f22d6958e91e3 |
| turbo-cache-control | no-preview |
| go-import | github.com/StackStorm-Exchange/stackstorm-openstack git https://github.com/StackStorm-Exchange/stackstorm-openstack.git |
| octolytics-dimension-user_id | 20677668 |
| octolytics-dimension-user_login | StackStorm-Exchange |
| octolytics-dimension-repository_id | 75043220 |
| octolytics-dimension-repository_nwo | StackStorm-Exchange/stackstorm-openstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 75043220 |
| octolytics-dimension-repository_network_root_nwo | StackStorm-Exchange/stackstorm-openstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 023691d14ad20c90d3ee61b0a0977b17dc6b6361 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width