Skip to content

Commit

Permalink
Update minikube status check (#846)
Browse files Browse the repository at this point in the history
* Update logic to check whether minikube is already running.

* Updated except to check for CalledProcessError.

* Merge branch 'master' into minikube-run-start
  • Loading branch information
faucomte97 committed Oct 12, 2018
1 parent f188996 commit 408a1f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions aimmo_runner/minikube.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/user/bin/env python
from __future__ import print_function

from subprocess import CalledProcessError

import docker
import kubernetes
import os
Expand Down Expand Up @@ -74,10 +76,10 @@ def start_cluster(minikube):
Starts the cluster unless it has been already started by the user.
:param minikube: Executable minikube installed beforehand.
"""
status = run_command([minikube, 'status'], True)
if 'minikube: Running' in status:
try:
run_command([minikube, 'status'], True)
print('Cluster already running')
else:
except CalledProcessError:
run_command([minikube, 'start', '--memory=2048', '--cpus=2'])


Expand Down

0 comments on commit 408a1f6

Please sign in to comment.