ansible-collections/ibm.spectrum_virtualize

svcinfo lshostvdiskmap fails if device name starts with ls

tigerphoenixdragon opened this issue · 5 comments

SUMMARY

We have an ansible playbook we are trying to use for taking flash copies for a system. We use the name of the system in the flash copy name as part of our naming scheme, so when looking up which subsystem owns a server, we use "svcinfo lshostvdiskmap " to see if it's on this subsystem so we can identify which subsystem to request the flash copy on.

Our naming scheme for our servers has some of our servers starting with an "ls" in the name. The error we see when we try to run this module is "CMMVC5737E The parameter [-json] has been entered multiple times. Enter the parameter only one time."

A check of the log created by the log_path directive indicates that it is indeed passing "-json" on the end after it already passed it in front of the server name such as below:
ibm_svcinfo_command.py:send_svcinfo_command():202 Executing CLI command: svcinfo lshostvdiskmap -json lsone -json

A check of the module code for ibm_svcinfo_command.py shows the following code is the likely issue:
def modify_command(self, argument):
return ' '.join([c.strip() if not c.startswith('ls') else c + " -json" for c in argument.strip().split()])

ISSUE TYPE
  • Bug Report
COMPONENT NAME

module ibm_svcinfo_command.py

ANSIBLE VERSION
ansible 2.9.13
   config file = /etc/ansible/ansible.cfg
   configured module search path = ['/home/redacted/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
   ansible python module location = /usr/lib/python3.6/site-packages/ansible
   executable location = /usr/bin/ansible
   python version = 3.6.8 (default, Mar 18 2021, 08:58:41) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
COLLECTION VERSION
1.5.0
CONFIGURATION

OS / ENVIRONMENT

Red Hat 8 on x86_64

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

Thanks, will look into the issue.

Just curious if any progress has been made on this.

Hi. Yes expect the fix in our upcoming release. Thanks.

The issue is fixed in IBM Spectrum Virtualize Ansible collection v1.6.0

Closing the issue.