Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/ConPaaS-team/conpaas into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gpierre42 committed Oct 27, 2014
2 parents 4de8b3f + 350cb46 commit 9f90d20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions conpaas-director/cpsdirector/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,16 @@ def stop(serviceid):
if not service:
return build_response(simplejson.dumps(False))

# Try to cleanly terminate the service by calling the manager
# Try to cleanly terminate the service
try:
callmanager(serviceid, "delete", True, {})
# If the service is in INIT or STOPPED state, we can just kill
# the manager VM
res = callmanager(serviceid, "get_service_info", False, {})
if res['state'] == 'INIT' or res['state'] == 'STOPPED':
service.stop()
else:
# Else, we should ask the manager to cleanly shut down itself
callmanager(serviceid, "delete", True, {})
# If this fails, forcefully terminate the manager VM
except:
service.stop()
Expand Down
2 changes: 1 addition & 1 deletion conpaas-services/src/conpaas/core/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def create_nodes(self, count, test_agent, port, cloud=None, inst_type=None):
if self.role == 'manager':
role_abbr = 'mgr'
else:
role_abbr = 'agn'
role_abbr = 'agt'

# eg: conpaas-online-u3-s1-xtreemfs-mgr
name = "%s-u%s-s%s-%s-%s" % (self.__conpaas_name, self.__conpaas_user_id,
Expand Down

0 comments on commit 9f90d20

Please sign in to comment.