Skip to content

Commit

Permalink
new exception raising
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Mar 30, 2017
1 parent f0666cf commit 392ff53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rancher/service.py
Expand Up @@ -39,6 +39,8 @@

import time

import appier

class ServiceApi(object):

def list_services(self, *args, **kwargs):
Expand Down Expand Up @@ -85,7 +87,10 @@ def upgrade_service(
url = self.base_url + "services/%s?action=upgrade" % id
if try_finish: self._service_try_finish(id)
if launch_config == None: launch_config = self._service_launch_config(id)
if safe and not self._service_active(id): return
if safe and not self._service_active(id):
raise appier.OperationalError(
message = "Service is currently not ready for upgrade"
)
contents = self.post(
url,
data_j = dict(
Expand Down

0 comments on commit 392ff53

Please sign in to comment.