pcp
[Top] [All Lists]

[Bug 1287778] Python PMAPI pmNonOptionsFromList cryptic error message

To: pcp@xxxxxxxxxxx
Subject: [Bug 1287778] Python PMAPI pmNonOptionsFromList cryptic error message
From: bugzilla@xxxxxxxxxx
Date: Thu, 03 Dec 2015 01:35:45 +0000
Authentication-results: i-otc2esa.syd1.mail-filtering.com.au; spf=Pass smtp.mailfrom=bugzilla@xxxxxxxxxx; spf=Pass smtp.helo=postmaster@xxxxxxxxxxxxxxxxxxx
Auto-submitted: auto-generated
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <bug-1287778-355098@xxxxxxxxxxxxxxxxxxx>
Ironport-phdr: 9a23:Pf714xQ/ap512jkT5YNLgJ/f9dpsv+yvbD5Q0YIujvd0So/mwa65ZBSN2/xhgRfzUJnB7Loc0qyN4/6mATRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niabqo9X6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD88QIrJEbFP2mN+RlFf0LRAkgKH0/sc33qQHYH0zI7GYTQGQSlhMOGQXJ7BjmGJz2t2zmselw3m+RMsyhUeVudxegsodNF0/mxi5SPDUO7WfMl8Zrh7haqh/ymxsq24XMSIKYMvg4daTYO9oHFkRbWcMEXTFOEIK4a4InFecNPe9E6YL6oghd5SCiDBWhUbu8ggRDgWX7iPBi3g==
References: <bug-1287778-355098@xxxxxxxxxxxxxxxxxxx>
https://bugzilla.redhat.com/show_bug.cgi?id=1287778



--- Comment #1 from Nathan Scott <nathans@xxxxxxxxxx> ---
Looking at the code, I think the problem is that pmGetOptions must be called
before pmGetNonOptions[...] - because it uses optind and hence getopt state
from that earlier call.

Because pmrep is using the all-at-once parse-arguments-and-create-context
interface - i.e. .fromOptions() - that cannot happen in the right order by
definition.

However, pmrep could just call the pmContext constructor directly - see the
fromOptions code around line 1068 of src/python/pcp/pmapi.py for what happens
now.

cheers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug 
https://bugzilla.redhat.com/token.cgi?t=2FKj5HN78f&a=cc_unsubscribe

<Prev in Thread] Current Thread [Next in Thread>