启动targetcli时遇到错误解决办法
技术  /  管理员 发布于 7年前   252
启动targetcli时遭遇ImportError: cannot import name ALUATargetPortGroup故障
targetcli是一个iSCSI配置管理工具,该工具简单易用,可以直接替换scsi-target-utils。满心欢喜的装上它,正准备一睹为快,就杯具了。报错ImportError: cannot import name ALUATargetPortGroup。下面就这针对这个错误的解决方案。
一、故障现象
当前环境[root@centos7-router ~]# more /etc/redhat-release CentOS Linux release 7.2.1511 (Core)安装targetcli工具包# yum install targetcli故障现象[root@centos7-router ~]# targetcliTraceback (most recent call last): File "/usr/bin/targetcli", line 24, in <module> from targetcli import UIRoot ### Author : Leshami File "/usr/lib/python2.7/site-packages/targetcli/__init__.py", line 18, in <module> from .ui_root import UIRoot ### Blog : http://blog.csdn.net/leshami File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 30, in <module> from .ui_backstore import complete_path, UIBackstores File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 29, in <module> from rtslib_fb import ALUATargetPortGroupImportError: cannot import name ALUATargetPortGroup
二、解决方案
从上面的错误提示可知,python文件有问题。于是验证一下python是否已正确安装[root@centos7-router ~]# pythonPython 2.7.5 (default, Nov 20 2015, 02:00:19) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> python可以正常工作,继续google,原来是缺少python-rtslib这个包。[root@centos7-router ~]# yum install python-rtslib -y再次执行成功[root@centos7-router ~]# targetclitargetcli shell version 2.1.fb46Copyright 2011-2013 by Datera, Inc and others.For help on commands, type 'help'./> helpGENERALITIES============This is a shell in which you can create, delete and configureconfiguration objects.The available commands depend on the current path or targetpath you want to run a command in: different path havedifferent sets of available commands, i.e. a path pointing atan iscsi target will not have the same availaible commands as,say, a path pointing at a storage object.The prompt that starts each command line indicates yourcurrent path. Alternatively (useful if the prompt displaysan abbreviated path to save space), you can run thepwd command to display the complete current path.Navigating the tree is done using the cd command. Withoutany argument, cd will present you wil the full objectstree. Just use arrows to select the destination path, andenter will get you there. Please try help cd for navigationtips.COMMAND SYNTAX==============Commands are built using the following syntax:[TARGET_PATH] COMMAND_NAME [OPTIONS]The TARGET_PATH indicates the path to run the command from.If ommited, the command will be run from your current path.The OPTIONS depend on the command. Please use helpCOMMAND to get more information.AVAILABLE COMMANDS==================The following commands are available in thecurrent path: - bookmarks action [bookmark] - cd [path] - clearconfig [confirm] - exit - get [group] [parameter...] - help [topic] - ls [path] [depth] - pwd - refresh - restoreconfig [savefile] [clear_existing] - saveconfig [savefile] - sessions [action] [sid] - set [group] [parameter=value...] - status - version
如有疑问,请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号