Commit 0018e9a2 authored by Marco Mariani's avatar Marco Mariani

SlapObject: removed method getSupervisorRPC

parent 01c6cd7e
...@@ -343,11 +343,11 @@ class Partition(object): ...@@ -343,11 +343,11 @@ class Partition(object):
os.chown(path, uid, gid) os.chown(path, uid, gid)
def getUserGroupId(self): def getUserGroupId(self):
"""Returns tuple of (uid, gid) of partition""" """Returns (uid, gid) tuple of partition owner"""
stat_info = os.stat(self.instance_path) stat_info = os.stat(self.instance_path)
uid = stat_info.st_uid uid = stat_info.st_uid
gid = stat_info.st_gid gid = stat_info.st_gid
return (uid, gid) return uid, gid
def addServiceToGroup(self, partition_id, def addServiceToGroup(self, partition_id,
runner_list, path, extension=''): runner_list, path, extension=''):
...@@ -551,7 +551,7 @@ class Partition(object): ...@@ -551,7 +551,7 @@ class Partition(object):
"""Asks supervisord to start the instance. If this instance is not """Asks supervisord to start the instance. If this instance is not
installed, we install it. installed, we install it.
""" """
supervisor = self.getSupervisorRPC() supervisor = getSupervisorRPC(self.supervisord_socket)
partition_id = self.computer_partition.getId() partition_id = self.computer_partition.getId()
try: try:
supervisor.startProcessGroup(partition_id, False) supervisor.startProcessGroup(partition_id, False)
...@@ -566,7 +566,7 @@ class Partition(object): ...@@ -566,7 +566,7 @@ class Partition(object):
"""Asks supervisord to stop the instance.""" """Asks supervisord to stop the instance."""
partition_id = self.computer_partition.getId() partition_id = self.computer_partition.getId()
try: try:
supervisor = self.getSupervisorRPC() supervisor = getSupervisorRPC(self.supervisord_socket)
supervisor.stopProcessGroup(partition_id, False) supervisor.stopProcessGroup(partition_id, False)
except xmlrpclib.Fault as exc: except xmlrpclib.Fault as exc:
if exc.faultString.startswith('BAD_NAME:'): if exc.faultString.startswith('BAD_NAME:'):
...@@ -628,16 +628,13 @@ class Partition(object): ...@@ -628,16 +628,13 @@ class Partition(object):
""" """
raise NotImplementedError raise NotImplementedError
def getSupervisorRPC(self):
return getSupervisorRPC(self.supervisord_socket)
def updateSupervisor(self): def updateSupervisor(self):
"""Forces supervisord to reload its configuration""" """Forces supervisord to reload its configuration"""
# Note: This method shall wait for results from supervisord # Note: This method shall wait for results from supervisord
# In future it will not be needed, as update command # In future it will not be needed, as update command
# is going to be implemented on server side. # is going to be implemented on server side.
self.logger.debug('Updating supervisord') self.logger.debug('Updating supervisord')
supervisor = self.getSupervisorRPC() supervisor = getSupervisorRPC(self.supervisord_socket)
# took from supervisord.supervisorctl.do_update # took from supervisord.supervisorctl.do_update
result = supervisor.reloadConfig() result = supervisor.reloadConfig()
added, changed, removed = result[0] added, changed, removed = result[0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment