From 3d41f89186e095f18d1031a8555a8027c31d25b1 Mon Sep 17 00:00:00 2001 From: Junaid Ali Date: Wed, 27 Apr 2016 20:42:02 -0700 Subject: [PATCH] Updated restart_pg function --- hooks/pg_dir_utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hooks/pg_dir_utils.py b/hooks/pg_dir_utils.py index 1c1d6fc..b76ddd7 100644 --- a/hooks/pg_dir_utils.py +++ b/hooks/pg_dir_utils.py @@ -157,10 +157,9 @@ def restart_pg(): else: if service_start('libvirt-bin'): time.sleep(3) - if not service_running('plumgrid'): - if not service_start('plumgrid'): - raise ValueError("plumgrid service couldn't be started" - ) + if not service_running('plumgrid') \ + and not service_start('plumgrid'): + raise ValueError("plumgrid service couldn't be started") else: raise ValueError("libvirt-bin service couldn't be started") status_set('active', 'Unit is ready')