`console log show xxx` broke without `--lines` option

Bug #1316870 reported by xyj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
xyj

Bug Description

Error seen:

(openstack) console log show bf871e90-0850-4f1d-a770-3126c1beb560
ERROR: cliff.app unsupported operand type(s) for +: 'NoneType' and 'int'

Reason:

The parser defaults the lines variable to None.

        parser.add_argument(
            '--lines',
            metavar='<num-lines>',
            type=int,
            default=None,
            help='Number of lines to display from the end of the log '
                 '(default=all)',
        )

However we end up trying to add an int value of 1 in some cases.

        data = server.get_console_output(length=parsed_args.lines + 1)

xyj (xyj-asmy)
Changed in python-openstackclient:
assignee: nobody → xyj (xyj-asmy)
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to python-openstackclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/92501

Changed in python-openstackclient:
status: New → In Progress
description: updated
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/92501
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=3b57117f8efc0c945f730c5e8a598768ac774114
Submitter: Jenkins
Branch: master

commit 3b57117f8efc0c945f730c5e8a598768ac774114
Author: Yejia Xu <email address hidden>
Date: Wed May 7 01:49:15 2014 +0000

    Display all server log when --lines option is None

    Without --lines option, `console log show xxx`
    cmd will break.

    Change-Id: I4027aacac245e6916c1808fd9f878fb708c8a5f0
    Closes-Bug: #1316870

Changed in python-openstackclient:
status: In Progress → Fix Committed
Dean Troyer (dtroyer)
Changed in python-openstackclient:
milestone: none → m4
Dean Troyer (dtroyer)
Changed in python-openstackclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.