Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nic create/update without vlan id fails #291

Closed
andy-maier opened this issue Sep 6, 2022 · 0 comments · Fixed by #293 or #294
Closed

nic create/update without vlan id fails #291

andy-maier opened this issue Sep 6, 2022 · 0 comments · Fixed by #293 or #294

Comments

@andy-maier
Copy link
Member

andy-maier commented Sep 6, 2022

Actual behavior

Certain operations on NICs such as "nic create" or "nic update" fail when the --vlan-id option is not specified.

For example:

$ zhmc nic create CPCB dal2-qz2-sr2-rk070-s21 --name IMGMT2 --description "Management port" --adapter MGMT2 --port 1 --device-number 1350
Traceback (most recent call last):
  File "/usr/local/bin/zhmc", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/zhmccli/_cmd_nic.py", line 151, in nic_create
    cmd_ctx.execute_cmd(lambda: cmd_nic_create(cmd_ctx, cpc, partition,
  File "/usr/local/lib/python3.6/dist-packages/zhmccli/_helper.py", line 318, in execute_cmd
    cmd()
  File "/usr/local/lib/python3.6/dist-packages/zhmccli/_cmd_nic.py", line 152, in <lambda>
    options))
  File "/usr/local/lib/python3.6/dist-packages/zhmccli/_cmd_nic.py", line 418, in cmd_nic_create
    set_vlan_id(cmd_ctx, properties, org_options)
  File "/usr/local/lib/python3.6/dist-packages/zhmccli/_cmd_nic.py", line 498, in set_vlan_id
    properties['vlan-id'] = int(vlan_id)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

This can be circumvented by specifying --vlan-id "".

Expected behavior

Should work without having to specify --vlan-id "".

Execution environment

  • zhmc version: 1.2.0
  • zhmcclient version: 1.3.3
  • Operating system (type+version): Ubuntu 18.04
  • HMC version: z15
  • CPC version: z15
@andy-maier andy-maier changed the title nic update without vlan id fails nic create/update without vlan id fails Sep 6, 2022
@andy-maier andy-maier self-assigned this Sep 6, 2022
@andy-maier andy-maier added this to the 1.3.0 milestone Sep 6, 2022
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Fixed that the 'vlan-type' property was not set in the HMC request
  when --vlan-id was used in 'zhmc nic create'. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
@andy-maier andy-maier linked a pull request Sep 28, 2022 that will close this issue
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Fixed that the 'vlan-type' property was not set in the HMC request
  when --vlan-id was used in 'zhmc nic create'. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
@andy-maier andy-maier linked a pull request Sep 28, 2022 that will close this issue
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Added a '--vlan-type' option to 'zhmc nic create' and 'zhmc nic update' to
  set the VLAN type. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Added a '--vlan-type' option to 'zhmc nic create' and 'zhmc nic update' to
  set the VLAN type. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Added a '--vlan-type' option to 'zhmc nic create' and 'zhmc nic update' to
  set the VLAN type. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
andy-maier added a commit that referenced this issue Sep 28, 2022
Details:

* Fixed that --vlan-id could not be ommitted in 'zhmc nic create' and
  'zhmc nic update'. (issue #291)

* Added a '--vlan-type' option to 'zhmc nic create' and 'zhmc nic update' to
  set the VLAN type. (issue #292)

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment