Bug 1289912 - Python PMAPI command line parsing
Python PMAPI command line parsing
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: pcp (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Nathan Scott
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-09 05:41 EST by Marko Myllynen
Modified: 2017-06-09 15:02 EDT (History)
7 users (show)

See Also:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-05-27 23:56:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marko Myllynen 2015-12-09 05:41:09 EST
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 09:05:27 EST
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 09:22:17 EST
See also https://github.com/performancecopilot/pcp/issues/195
Comment 3 Fedora End Of Life 2017-02-28 04:51:19 EST
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 03:25:52 EDT
This is fixed by upstream commit 0d4227aa8e4 & should be in pcp-3.11.10 (in a week or so).

Author: Nathan Scott <nathans@redhat.com>
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 12:25:24 EDT
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 12:30:45 EDT
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 12:31:52 EDT
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 17:09:59 EDT
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-19 21:05:55 EDT
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-19 23:01:40 EDT
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-27 23:56:47 EDT
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 02:00:32 EDT
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 15:02:22 EDT
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.