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

Fixed a bug when alcli crashed on an empty response. Updated to use t… #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion alcli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '1.0.12'
__version__ = '1.0.13'
__author__ = 'Alert Logic, Inc.'
7 changes: 5 additions & 2 deletions alcli/alertlogic_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def cli_pager(text):

def get_cli_pager():
if sys.platform == 'win32':
return lambda text: pydoc.pipepager(text, 'more -C')
return lambda text: pydoc.pipepager(text, 'more /C')
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
return lambda text: pydoc.pipepager(text, 'less -R')

Expand Down Expand Up @@ -172,7 +172,10 @@ def __call__(self, args, parsed_globals):
# Remove optional arguments that haven't been supplied
op_args = {k:self._encode(operation, k, v) for (k,v) in kwargs.items() if v is not None}
res = operation(**op_args)
self._print_result(res.json(), parsed_globals.query)
try:
self._print_result(res.json(), parsed_globals.query)
except JSONDecodeError:
print(f"status code: {res.status_code}")

@property
def client(self):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
alertlogic-sdk-python>=1.0.14
alertlogic-sdk-python>=1.0.15
jmespath>=0.9.4
certifi==2019.11.28
chardet==3.0.4
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
history = history_file.read()

requirements = [
'alertlogic-sdk-python>=1.0.14',
'alertlogic-sdk-python>=1.0.15',
'configparser>=4.0.2',
'pyyaml==5.1.2',
'jmespath>=0.9.4'
Expand Down