pcp
[Top] [All Lists]

Re: [pcp] pmrep: fix timezone handling/reporting

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] pmrep: fix timezone handling/reporting
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Tue, 9 Feb 2016 12:51:26 +0200
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <100014106.19398619.1454968236965.JavaMail.zimbra@xxxxxxxxxx>
Organization: Red Hat
References: <56AF6E49.1040404@xxxxxxxxxx> <2118214472.19115278.1454909945154.JavaMail.zimbra@xxxxxxxxxx> <56B8A997.6070903@xxxxxxxxxx> <100014106.19398619.1454968236965.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
Hi,

On 2016-02-08 23:50, Nathan Scott wrote:
> ----- Original Message -----
>> [...]
>>> As discussed in that other thread, we've managed to avoid some helper
>>> routines in pmrep (pmGetContextOptions in particular) which might've
>>> made some of this easier, not sure (if we are really out of sync, we
>>> will not be helped by that I guess).
>>
>> One reason why we've avoided using pmGetContextOptions in pmrep is that
>> it's not available via the Python PMAPI :-)
> 
> Its there, its just not directly called - pmContext.fromOptions builder
> interface makes use of it (hmm, which pmrep already uses?) via:
> 
>         # finish time windows, timezones, archive access mode
>         if c_api.pmSetContextOptions(context.ctx, options.mode, 
> options.delta):
>             raise pmUsageErr
> 
> (which internally calls pmGetContextOptions)

Ah ok, I didn't see pmGetContextOptions in pmapi.py thus thought it's
not available. But yes, pmrep already uses pmContext.fromOptions:

    def connect(self):
        """ Establish a PMAPI context to archive, host or local, via
args """
        self.context = pmapi.pmContext.fromOptions(self.opts, sys.argv)


Thanks,

-- 
Marko Myllynen

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