diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fc00890..0146a754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This file is used to list changes made in each version of cookbook-openstack-common. +## 8.0.1: +### Bug +* Add sleep to search_for function, so that node can be searched + ## 8.0.0: * Upgrading to Havana * Upgrading gems diff --git a/README.md b/README.md index 06df5c6b..d94b2d41 100644 --- a/README.md +++ b/README.md @@ -201,11 +201,13 @@ License and Author | **Author** | Craig Tracey () | | **Author** | Sean Gallagher () | | **Author** | Ionut Artarisi () | +| **Author** | Chen Zhiwei () | | | | | **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. | | **Copyright** | Copyright (c) 2013, Opscode, Inc. | | **Copyright** | Copyright (c) 2013, Craig Tracey | | **Copyright** | Copyright (c) 2013, SUSE Linux GmbH | +| **Copyright** | Copyright (c) 2013, IBM, Corp. | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/libraries/search.rb b/libraries/search.rb index 8e97c6e2..953fadee 100644 --- a/libraries/search.rb +++ b/libraries/search.rb @@ -26,8 +26,16 @@ module ::Openstack role_query = "(chef_environment:#{node.chef_environment} AND roles:#{r})" recipe_query = "(chef_environment:#{node.chef_environment} AND recipes:#{r})".sub("::","\\:\\:") query = "#{role_query} OR #{recipe_query}" - - resp = search(:node, query, &block) + count = 1 + sum = 7 + while count < sum do + resp = search(:node, query, &block) + if resp != nil + break + end + sleep 2**count + count += 1 + end resp ? resp : [] end diff --git a/metadata.rb b/metadata.rb index f79b495d..edd6adf5 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com" license "Apache 2.0" description "Common OpenStack attributes, libraries and recipes." long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "8.0.0" +version "8.0.1" recipe "openstack-common", "Installs/Configures common recipes" recipe "openstack-common::set_endpoints_by_interface", "Set endpoints by interface"