Skip to content

Add CLI commands showversion and showlicense #32

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions hpe3parclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4033,3 +4033,39 @@ def _format_srstatld_output(self, out):
'avg_busy_perc': float(line[15])
}
return formatted

def getVersion(self, opt_a=False, opt_b=False, opt_s=False):
"""Get the output of the showversion command

:param opt_a: Specify option -a (Show all component versions)
:param opt_b: Specify option -b (Show build levels)
:param opt_b: Specify option -s (Show release version number only)
:returns: dict with total and members
(see convert_cli_output_to_collection_like_wsapi())

"""
cmd = ['showversion']
if opt_a:
cmd.append('-a')
if opt_b:
cmd.append('-b')
if opt_s:
cmd.append('-s')
return self._convert_cli_output_to_collection_like_wsapi(
self._run(cmd))

def getLicense(self, opt_raw=False):
"""Get all the output of the license command

:param opt_raw: Specifies that the license key originally entered (the raw license) be displayed
:returns: dict with total and members
(see convert_cli_output_to_collection_like_wsapi())

"""
cmd = ['showlicense']
if opt_raw:
cmd.append('-raw')
return self._convert_cli_output_to_collection_like_wsapi(
self._run(cmd))