#2409 CLI :: pki-server subsystem-disable should display proper message
Closed: Duplicate Opened by myusuf@redhat.com.

pki-server subsystem-disable should display proper error message when ran
with invalid subsystem type.

Steps to Reproduce:

run pki-server subsystem-disable command with invalid subsystem type

Actual results:

[root@pki1 ca]# pki-server subsystem-disable -i pki-tomcat adqsd
Traceback (most recent call last):
  File "/usr/sbin/pki-server", line 112, in <module>
    cli.execute(sys.argv)
  File "/usr/sbin/pki-server", line 104, in execute
    super(PKIServerCLI, self).execute(args)
  File "/usr/lib/python2.7/site-packages/pki/cli/__init__.py", line 203, in
execute
    module.execute(module_args)
  File "/usr/lib/python2.7/site-packages/pki/cli/__init__.py", line 203, in
execute
    module.execute(module_args)
  File "/usr/lib/python2.7/site-packages/pki/server/cli/subsystem.py", line
311, in execute
    subsystem.disable()
AttributeError: 'NoneType' object has no attribute 'disable'

Expected results:

It should display proper message specifying invalid subsystem type

Additional info:

It should throw proper message when try to disable already disabled
subsystem
Steps to Reproduce:
1. disable the subsystem with pki-server subsystem-disable command
2. try to disable same instance again.
Actual results:
[root@pki1 ca]# pki-server subsystem-disable -i pki-tomcat ca
-----------------------
Disabled "ca" subsystem
-----------------------
  Subsystem ID: ca
  Instance ID: pki-tomcat
  Enabled: False
[root@pki1 ca]# pki-server subsystem-disable -i pki-tomcat ca
Traceback (most recent call last):
  File "/usr/sbin/pki-server", line 112, in <module>
    cli.execute(sys.argv)
  File "/usr/sbin/pki-server", line 104, in execute
    super(PKIServerCLI, self).execute(args)
  File "/usr/lib/python2.7/site-packages/pki/cli/__init__.py", line 203, in
execute
    module.execute(module_args)
  File "/usr/lib/python2.7/site-packages/pki/cli/__init__.py", line 203, in
execute
    module.execute(module_args)
  File "/usr/lib/python2.7/site-packages/pki/server/cli/subsystem.py", line
311, in execute
    subsystem.disable()
  File "/usr/lib/python2.7/site-packages/pki/server/__init__.py", line 325, in
disable
    self.instance.undeploy(self.name)
  File "/usr/lib/python2.7/site-packages/pki/server/__init__.py", line 780, in
undeploy
    os.remove(context_xml)
OSError: [Errno 2] No such file or directory:
'/var/lib/pki/pki-tomcat/conf/Catalina/localhost/ca.xml'
Expected results:
It should display proper message specifying that subsystem is already disabled.

This is already fixed in ticket #2399.

Metadata Update from @myusuf@redhat.com:
- Issue set to the milestone: 10.3.5

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2529

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata