On Fri, Mar 19, 2010 at 9:03 AM, [email protected] <[email protected]> wrote: > node = filter(lambda x: x.name == 'test', nodes)[0] > > "x" is a list, not a node, so it throws an Exception.
Whoops! > Here's a more readable approach that reboots any node named "test", and that > shows that the provider has to be accessed by Node.driver.name, not > Node.provider as is implied by the string printed out by Node.__repr__: > > # List out the nodes, grouped by provider and reboot any node named "test" > for provider in nodes: > if provider: > print "Provider: %s" % provider[0].driver.name > for node in provider: > print "Node : %s" % node.name > if node.name == "test": > node.reboot() > > I haven't cloned the repo yet...which of the git mirrors is the best for > submitting pull requests? Use http://github.com/apache/libcloud, which syncs with the SVN repo. Just submit patches to the list. Thanks! -Alex -- co-founder, cloudkick.com twitter.com/cloudkick 541 231 0624
