kenperkins/rackspace-openstack — pull request #6 by adregner (2013-03-17 15:57:29+00:00)
Title: setWait for a value to not be equal to something

I needed a way to build a server and wait until it was both active, and it had the accessIPv4 fields populated. using setWait would return when it was active, but in about 70% of cases, the accessIPv4 field was not populated for until another couple of seconds. my choices were to either implement my own polling system that could do this, or this small patch to enable it in rackspace-openstack. this seemed cleaner.

-------------

this enables an attribute to be provided to Server.setWait and it will wait until it is not equal to the associated value. example:

server.setWait(
{ status:'ACTIVE', accessIPv4:{$ne:''} },
{ interval:2000 },
function(err, server) {
// We now know that the server is active and that
// the accessIPv4 property has been populated.
}
);