Skip to content

Commit

Permalink
Merge pull request #33 from billdodd/fix/term_size
Browse files Browse the repository at this point in the history
Fix OSError when piping output of rf_logs.py
  • Loading branch information
mraineri authored Mar 13, 2020
2 parents bff6d5a + a33830d commit 3820743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redfish_utilities/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
with the log service for a given Redfish service
"""

import os
import shutil

from .messages import verify_response
from enum import Enum
Expand Down Expand Up @@ -75,7 +75,7 @@ def print_log_entries( log_entries, details = False ):
"""

# Set up templates
console_size = os.get_terminal_size()
console_size = shutil.get_terminal_size(fallback=(80, 24))
message_size = console_size.columns - 38
entry_line_format = " {:5s} | {:25s} | {}"
detail_line_format = " {:33s} | {}: {}"
Expand Down
3 changes: 3 additions & 0 deletions scripts/rf_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"""

import argparse
import sys

import redfish
import redfish_utilities

Expand Down Expand Up @@ -60,3 +62,4 @@
redfish_utilities.print_log_entries( log_entries, args.details )
finally:
redfish_obj.logout()
sys.stderr.close()

0 comments on commit 3820743

Please sign in to comment.