Skip to content

Commit

Permalink
Fixed emgr module for issue #383
Browse files Browse the repository at this point in the history
Signed-off-by: Nitish K Mishra <[email protected]>
  • Loading branch information
nitismis committed Dec 4, 2023
1 parent fb20e95 commit 1bd59c2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions plugins/modules/emgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,10 @@ def main():
if action == 'install':

# check if ifix is already installed in the system
if is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is already installed. Nothing to do.'
module.exit_json(**results)
if module.params['ifix_package']:
if is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is already installed. Nothing to do.'
module.exit_json(**results)

# Usage: emgr -e <ifix pkg> | -f <lfile> [-w <dir>] [-a <path>] [-bkpIqmoX]
# Usage: emgr -i <ifix pkg> | -f <lfile> [-w <dir>] [-a <path>] [-CkpIqX]
Expand Down Expand Up @@ -493,9 +494,10 @@ def main():

elif action == 'remove' and module.params['force']:
# Usage: emgr -R <ifix label> [-w <dir>] [-a <path>] [-X]
if not is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is NOT installed in the system. Nothing to do.'
module.exit_json(**results)
if module.params['ifix_package']:
if not is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is NOT installed in the system. Nothing to do.'
module.exit_json(**results)
if not module.params['ifix_label']:
results['msg'] = 'Missing parameter: force remove requires: ifix_label'
module.fail_json(**results)
Expand All @@ -509,9 +511,10 @@ def main():

elif action == 'remove':
# Usage: emgr -r -L <label> | -n <ifix num> | -u <VUID> | -f <lfile> [-w <dir>] [-a <path>] [-bkpIqX]
if not is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is NOT installed in the system. Nothing to do.'
module.exit_json(**results)
if module.params['ifix_package']:
if not is_ifix_installed(module, module.params['ifix_package']):
results['msg'] = 'This ifix is NOT installed in the system. Nothing to do.'
module.exit_json(**results)
param_one_of(['ifix_label', 'ifix_number', 'ifix_vuid', 'list_file'])
cmd += ['-r']
if module.params['ifix_label']:
Expand Down

0 comments on commit 1bd59c2

Please sign in to comment.