Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75168

Re: Using pyVmomi

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'elegant': 0.07; 'calls.': 0.09; 'decorator': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'scripting': 0.09; '~ethan~': 0.09; 'blocks': 0.16; 'invoking': 0.16; 'retry': 0.16; 'vmware': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'helper': 0.24; 'server.': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'properties': 0.29; 'code': 0.31; 'anyone': 0.31; 'run': 0.32; 'style': 0.33; "i'd": 0.34; 'possible.': 0.35; 'objects': 0.35; 'programming,': 0.36; 'scheme': 0.36; 'doing': 0.36; 'entry': 0.36; 'charset:us-ascii': 0.36; 'checks': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'received:173': 0.61; 'revalidate': 0.84; 'subject:Using': 0.84; 'surpasses': 0.84
Date Thu, 24 Jul 2014 11:33:48 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: Using pyVmomi
References <5052250e4c3f458386f00670acbf8e4d@exch.activenetwerx.com>
In-Reply-To <5052250e4c3f458386f00670acbf8e4d@exch.activenetwerx.com>
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12291.1406226830.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406226830 news.xs4all.nl 2968 [2001:888:2000:d::a6]:53692
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75168

Show key headers only | View raw


On 07/23/2014 01:14 PM, Joseph L. Casale wrote:
>
> I am doing some scripting with pyVmomi under 2.6.8 so the code may
> run directly on a vmware esxi server.
>
> As the code is long running, it surpasses the authentication timeout. For
> anyone familiar with this code and/or this style of programming, does anyone
> have a recommendation for an elegant authentication retry scheme for objects
> passed to code that will intermittently access the properties invoking calls.
>
> I'd prefer to not litter try/except blocks around the usage of the objects if
> possible.

You could:

   - have a single point of entry that can check and, if necessary, revalidate

   - create a helper that checks and, if necessary, revalidate, which is then
     called where ever needed

   - create a decorator that does the above for each function that needs it

--
~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Using pyVmomi Ethan Furman <ethan@stoneleaf.us> - 2014-07-24 11:33 -0700

csiph-web