Browse Source

Updated restart_pg function

Junaid Ali 3 years ago
parent
commit
02ace9b018
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      hooks/pg_gw_utils.py

+ 3
- 4
hooks/pg_gw_utils.py View File

@@ -157,10 +157,9 @@ def restart_pg():
157 157
         else:
158 158
             if service_start('libvirt-bin'):
159 159
                 time.sleep(3)
160
-                if not service_running('plumgrid'):
161
-                    if not service_start('plumgrid'):
162
-                        raise ValueError("plumgrid service couldn't be started"
163
-                                         )
160
+                if not service_running('plumgrid') \
161
+                        and not service_start('plumgrid'):
162
+                    raise ValueError("plumgrid service couldn't be started")
164 163
             else:
165 164
                 raise ValueError("libvirt-bin service couldn't be started")
166 165
     status_set('active', 'Unit is ready')

Loading…
Cancel
Save