"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "karbor/api/v1/services.py" between
karbor-1.1.0.tar.gz and karbor-1.3.0.tar.gz

About:

services.py  (karbor-1.1.0):services.py  (karbor-1.3.0)
skipping to change at line 89 skipping to change at line 89
transformed through view builder. transformed through view builder.
""" """
context = req.environ['karbor.context'] context = req.environ['karbor.context']
context.can(service_policy.GET_ALL_POLICY) context.can(service_policy.GET_ALL_POLICY)
host = req.GET['host'] if 'host' in req.GET else None host = req.GET['host'] if 'host' in req.GET else None
binary = req.GET['binary'] if 'binary' in req.GET else None binary = req.GET['binary'] if 'binary' in req.GET else None
try: try:
services = objects.ServiceList.get_all_by_args( services = objects.ServiceList.get_all_by_args(
context, host, binary) context, host, binary)
except exception as e: except Exception as e:
LOG.error('List service failed, reason: %s' % e) msg = (_('List service failed, reason: %s') % e)
raise raise exc.HTTPBadRequest(explanation=msg)
return self._view_builder.detail_list(req, services) return self._view_builder.detail_list(req, services)
def update(self, req, id, body): def update(self, req, id, body):
"""Enable/Disable scheduling for a service""" """Enable/Disable scheduling for a service"""
context = req.environ['karbor.context'] context = req.environ['karbor.context']
context.can(service_policy.UPDATE_POLICY) context.can(service_policy.UPDATE_POLICY)
try: try:
service = objects.Service.get_by_id(context, id) service = objects.Service.get_by_id(context, id)
except exception.ServiceNotFound as e: except exception.ServiceNotFound as e:
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)