本文整理汇总了Python中stackone.core.utils.utils.print_traceback函数的典型用法代码示例。如果您正苦于以下问题:Python print_traceback函数的具体用法?Python print_traceback怎么用?Python print_traceback使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_traceback函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_all_instance_categories
def get_all_instance_categories(self):
try:
return self.csep_service.get_all_instance_categories_db(session.get('servicepoint_id'))
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex
示例2: get_all_zones
def get_all_zones(self, region_id):
try:
return self.csep_service.get_all_zones_db(region_id)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex
示例3: get_sp_list
def get_sp_list(self, site_id, def_id=None, pool_tag=None, pool_id=None, _dc=None):
try:
result = self.manager.get_sp_list(site_id, def_id, session['auth'], pool_tag, pool_id)
return result
except Exception as ex:
print_traceback()
return dict(success=False, msg=to_str(ex).replace("'", ''))
示例4: getVmDetails
def getVmDetails(self, vmid):
try:
return self.cms_cloud_service.getVmDetails(vmid)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex
示例5: get_vnc_info
def get_vnc_info(self, node_id, dom_id):
try:
result = None
result = self.controller_impl.get_vnc_info(node_id, dom_id)
except Exception as ex:
print_traceback()
return dict(success=True, vnc=result)
示例6: associate_defns
def associate_defns(self, site_id, group_id, def_type, def_ids, auth, op_level=None):
error_desc = ''
site = self.manager.getSite(site_id)
group = self.manager.getGroup(auth, group_id)
group_list = self.manager.getGroupList(auth, site_id)
def_id_list = def_ids.split(',')
for def_id in def_id_list:
new_sd = DBSession.query(StorageDef).filter_by(id=def_id).first()
node = None
sp_ids = group_id
try:
self.sync_manager.add_defn(new_sd, site, group, node, auth, to_unicode(constants.STORAGE), constants.ATTACH, 'ADD_STORAGE_DEF', self.storage_manager, self.manager, op_level, sp_ids)
except Exception as ex:
error_desc = to_str(ex)
print_traceback()
LOGGER.error(to_str(ex).replace("'", ''))
add_mode = True
try:
self.sync_manager.remove_defn(new_sd, site, group, node, auth, to_unicode(constants.STORAGE), constants.DETACH, 'REMOVE_STORAGE_DEF', self.storage_manager, self.manager, add_mode, group_list, op_level)
except Exception as ex1:
print_traceback()
LOGGER.error(to_str(ex1).replace("'", ''))
raise Exception(to_str(ex1))
if error_desc:
raise Exception(error_desc)
return {'success':True,'msg':'Storage Added'}
示例7: delete_volume
def delete_volume(self, name, storage_id):
try:
return self.csep_service.delete_volume(name, storage_id)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex
示例8: get_target_image_groups
def get_target_image_groups(self, auth, nodeId):
try:
manager = Basic.getGridManager()
managed_node = manager.getNode(auth, nodeId)
result = []
if managed_node is None:
raise Exception('Cannot find the Managed Node.')
result = []
mnode_ent = auth.get_entity(managed_node.id)
dc_ent = mnode_ent.parents[0].parents[0]
image_groups = self.image_store.get_image_groups(auth,dc_ent.entity_id)
for image_group in image_groups.itervalues():
count = 0
images = self.get_group_images(auth, image_group.id)
for image in images.itervalues():
if managed_node.is_image_compatible(image):
count = count + 1
break
if count > 0:
result.append(dict(name=image_group.get_name(), id=image_group.get_id()))
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex).replace("'", ''))
return ("{success: false,msg: '", to_str(ex).replace("'", ''), "'}")
return dict(success='true', image_groups=result)
示例9: list_user_operations
def list_user_operations(self, entname, username=None):
try:
result = self.model_controller.list_user_operations(entname,username)
return result
except Exception as e:
print_traceback()
return dict({'success':False,'msg':to_str(e)})
示例10: get_all_instance_types
def get_all_instance_types(self, category_id):
try:
return self.csep_service.get_all_instance_types_db(category_id)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex
示例11: has_permission
def has_permission(self, operation, entname, username=None):
try:
result = self.model_controller.has_permission(operation,entname,username)
return result
except Exception as e:
print_traceback()
return dict({'success':False,'msg':to_str(e)})
示例12: update_dc_params
def update_dc_params(self, res_id, fencing_name, fencing_id, params):
try:
params = json.loads(params).get('param_obj')
hafr = DBSession.query(HAFenceResource).filter(HAFenceResource.id == res_id).one()
hafr.name = fencing_name
params_list = []
for hp in hafr.params:
params_list.append(hp)
for i in range(len(params_list)):
hafr.params.remove(params_list[i])
for param in params:
name = param.get('attribute')
value = param.get('value')
type = param.get('type')
field = param.get('field')
field_datatype = param.get('field_datatype')
sequence = param.get('sequence')
harp = HAFenceResourceParam(name, value, type, field, field_datatype, sequence)
hafr.params.append(harp)
DBSession.add(hafr)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex).replace("'", ''))
return ("{success: false,msg: '", to_str(ex).replace("'", ''), "'}")
return dict(success=True)
示例13: list_user_operations
def list_user_operations(self, entname, username=None):
result = []
try:
ent = self.user_info.get_entity(entname)
if ent is None:
return dict(success=False, msg='The entity does not exists')
if username != None and username != '':
if session['auth'].is_admin_role() == False:
return dict(success=False, msg=constants.NO_PRIVILEGE)
userobj = self.user_info.get_user(username)
if userobj != None:
auth = AuthorizationService()
auth.user = userobj
ops = auth.get_ops(ent)
else:
return dict(success=False, msg='The user does not exists')
else:
ops = session['auth'].get_ops(ent)
for op in ops:
result.append(op.name)
return dict(success=True, ops=result)
except Exception as ex:
print_traceback()
return dict(success=False, msg=to_str(ex).replace("'", ''))
示例14: get_all_images
def get_all_images(self, group_id):
try:
self.authenticate()
result=self.image_service.get_all_images(session['auth'],group_id)
except Exception as ex:
print_traceback()
return dict(success=False,msg=to_str(ex).replace("'", ' '))
示例15: detach_volume
def detach_volume(self, context, disk_list):
try:
self.csep_service.detach_volume(context, disk_list)
except Exception as ex:
print_traceback()
LOGGER.error(to_str(ex))
raise ex