• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.print_traceback函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中stackone.core.utils.utils.print_traceback函数的典型用法代码示例。如果您正苦于以下问题:Python print_traceback函数的具体用法?Python print_traceback怎么用?Python print_traceback使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了print_traceback函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例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("'", ''))
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:NetworkController.py


示例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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例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)
开发者ID:yangliang913,项目名称:ovm,代码行数:7,代码来源:RootXMLRPCController.py


示例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'}
开发者ID:smarkm,项目名称:ovm,代码行数:26,代码来源:StorageService.py


示例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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例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)
开发者ID:smarkm,项目名称:ovm,代码行数:31,代码来源:ImageService.py


示例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)})
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:ModelXMLRPCController.py


示例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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例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)})
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:ModelXMLRPCController.py


示例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)
开发者ID:smarkm,项目名称:ovm,代码行数:28,代码来源:HAService.py


示例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("'", ''))
开发者ID:smarkm,项目名称:ovm,代码行数:31,代码来源:ModelController.py


示例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("'", ' '))
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:TemplateController.py


示例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
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例16: get_target_images

    def get_target_images(self, auth, nodeId, imageGroupId):
        try:
            manager = Basic.getGridManager()
            managed_node = manager.getNode(auth, nodeId)
            if managed_node is None:
                raise Exception('Cannot find the Managed Node.')
            result = []
            image_groups = {}
            if imageGroupId is not None:
                image_group = self.image_store.get_image_group(auth, imageGroupId)
                image_groups = {image_group.get_id():image_group}
            else:
                image_groups = self.image_store.get_image_groups(auth)
            
            for image_group in image_groups.itervalues():
                images = self.image_store.get_group_images(auth, image_group.id)
                for image in images.itervalues():
                    if managed_node.is_image_compatible(image) and not image.is_template:
                        result.append(dict(name=image.get_name(), id=image.get_id(), group_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', images=result)
开发者ID:smarkm,项目名称:ovm,代码行数:25,代码来源:ImageService.py


示例17: delete_storage_vdc_folders

 def delete_storage_vdc_folders(self, vdc_name):
     try:
         self.csep_service.delete_storage_vdc_folders(vdc_name)
     except Exception as ex:
         print_traceback()
         LOGGER.error(to_str(ex))
         raise ex
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例18: get_task_details

    def get_task_details(self, task_id):
        try:
            result = self.controller_impl.get_details_task(task_id)

        except Exception, ex:
            print_traceback()
            return dict({"success": False, "msg": to_str(ex).replace("'", "")})
开发者ID:yangliang913,项目名称:ovm,代码行数:7,代码来源:RootXMLRPCController.py


示例19: create_new_AMI

 def create_new_AMI(self, vdc_id, account_id, template_name, region_id, image_id, group_id):
     try:
         return self.cms_template_service.create_new_AMI(vdc_id, account_id, template_name, region_id, image_id, group_id)
     except Exception as ex:
         print_traceback()
         LOGGER.error(to_str(ex))
         raise ex
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:CMSCloudXMLRPC.py


示例20: add_image_group

 def add_image_group(self, group_name,store_id):
     try:
         result = self.template_controller.add_image_group(group_name,store_id)
     except Exception,ex:
         print_traceback()
         LOGGER.error(to_str(ex).replace("'",''))
         return "{success: false,msg: '" + to_str(ex).replace("'",'') +"'}"
开发者ID:smarkm,项目名称:ovm,代码行数:7,代码来源:TemplateAjaxController.py



注:本文中的stackone.core.utils.utils.print_traceback函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.to_str函数代码示例发布时间:2022-05-27
下一篇:
Python stackless.tasklet函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap