Add function that waits until Rmq units are clustered and ready
This commit is contained in:
@@ -11,3 +11,23 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import zaza.model
|
||||
|
||||
|
||||
def wait_for_cluster(model_name=None, timeout=1200):
|
||||
"""Wait for rmq units extended status to show cluster readiness,
|
||||
after an optional initial sleep period. Initial sleep is likely
|
||||
necessary to be effective following a config change, as status
|
||||
message may not instantly update to non-ready."""
|
||||
states = {
|
||||
'rabbitmq-server': {
|
||||
'workload-status-messages': 'Unit is ready and clustered'
|
||||
}
|
||||
}
|
||||
|
||||
zaza.model.wait_for_application_states(model_name=model_name,
|
||||
states=states,
|
||||
timeout=timeout)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user