Bug 1289912 - Python PMAPI command line parsing
Summary: Python PMAPI command line parsing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-09 10:41 UTC by Marko Myllynen
Modified: 2017-06-09 19:02 UTC (History)
7 users (show)

Fixed In Version: pcp-3.11.10-1.fc24 pcp-3.11.10-1.fc25 pcp-3.11.10-1.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-28 03:56:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Marko Myllynen 2015-12-09 10:41:09 UTC
Description of problem:
% cat t.py
#!/usr/bin/env python

import sys
import os

from pcp import pmapi

class T(object):
    def __init__(self):
        self.context = None
        self.opts = pmapi.pmOptions()
        self.opts.pmSetShortOptions("h:")
        self.opts.pmSetLongOptionHost()
        print pmapi.c_api.pmGetOptionsFromList(sys.argv)
        print self.opts.pmNonOptionsFromList(sys.argv)
        self.context = pmapi.pmContext.fromOptions(self.opts, sys.argv, self.opts.pmGetOptionContext())

if __name__ == '__main__':
    try:
        T()
    except pmapi.pmUsageErr as usage:
        usage.message()
% python ./t.py -h local: abc
0
['abc']
% python ./t.py abc -h local: 
0
['local:']
%

Comment 1 Fedora End Of Life 2016-11-24 14:05:27 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Frank Ch. Eigler 2016-11-24 14:22:17 UTC
See also https://github.com/performancecopilot/pcp/issues/195

Comment 3 Fedora End Of Life 2017-02-28 09:51:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 4 Nathan Scott 2017-05-09 07:25:52 UTC
This is fixed by upstream commit 0d4227aa8e4 & should be in pcp-3.11.10 (in a week or so).

Author: Nathan Scott <nathans>
Date:   Tue May 9 17:16:00 2017 +1000

    python api: handle non-POSIXLY_CORRECT getopt cases too
    
    Straight forward fix - hold into the copy of the re-ordered
    args vector for subsequent callers instead of discarding it
    after pmGetOptions.  Switch all callers in-tree over to the
    new API.
    
    Resolves Fedora BZ #1289912.

Comment 5 Fedora Update System 2017-05-18 16:25:24 UTC
pcp-3.11.10-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6992355779

Comment 6 Fedora Update System 2017-05-18 16:30:45 UTC
pcp-3.11.10-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a1605df5

Comment 7 Fedora Update System 2017-05-18 16:31:52 UTC
pcp-3.11.10-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-466341873d

Comment 8 Fedora Update System 2017-05-19 21:09:59 UTC
pcp-3.11.10-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c0a1605df5

Comment 9 Fedora Update System 2017-05-20 01:05:55 UTC
pcp-3.11.10-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6992355779

Comment 10 Fedora Update System 2017-05-20 03:01:40 UTC
pcp-3.11.10-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-466341873d

Comment 11 Fedora Update System 2017-05-28 03:56:47 UTC
pcp-3.11.10-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2017-05-28 06:00:32 UTC
pcp-3.11.10-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-06-09 19:02:22 UTC
pcp-3.11.10-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.