启动targetcli时遇到错误解决办法
作者:Leshami 发布时间:2023-03-20 05:59:43
标签:启动targetcli
启动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 ~]# targetcli
Traceback (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 ALUATargetPortGroup
ImportError: cannot import name ALUATargetPortGroup
二、解决方案
从上面的错误提示可知,python文件有问题。于是验证一下python是否已正确安装
[root@centos7-router ~]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
python可以正常工作,继续google,原来是缺少python-rtslib这个包。
[root@centos7-router ~]# yum install python-rtslib -y
再次执行成功
[root@centos7-router ~]# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> help
GENERALITIES
============
This is a shell in which you can create, delete and configure
configuration objects.
The available commands depend on the current path or target
path you want to run a command in: different path have
different sets of available commands, i.e. a path pointing at
an 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 your
current path. Alternatively (useful if the prompt displays
an abbreviated path to save space), you can run the
pwd command to display the complete current path.
Navigating the tree is done using the cd command. Without
any argument, cd will present you wil the full objects
tree. Just use arrows to select the destination path, and
enter will get you there. Please try help cd for navigation
tips.
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 help
COMMAND to get more information.
AVAILABLE COMMANDS
==================
The following commands are available in the
current 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
如有疑问,请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
来源:http://blog.csdn.net/leshami/article/details/78320262
0
投稿
猜你喜欢
- 采集文章给建站带来了很大的方便,特别是一些小网站,人员有限,资金有限,适当的使用采集功能可以很快丰富我们的网站,采集这么厉害可能你会觉的代码
- 在很多企业会使用闲置的 Windows 机器作为临时服务器,有时候我们想远程调用里面的程序或查看日志文件Windows 内置的服务
- 一、ASPJPEG文字水印对图片描边:程序代码: <% Set Jpeg = Se
- 本文实例为大家分享了python+rsync精确同步指定格式文件的具体代码,供大家参考,具体内容如下# coding: utf-8#!/us
- 1. 折线图折线图(Line Chart)是一种将数据点按照顺序连接起来的图形,也可以看作是将散点图按照X轴坐标顺序链接起来的图形。折线图的
- 解决2个问题:1.身份证之类的文本数据自动转为科学计数法的问题。2.中文乱码的问题excel从web页面上导出的原理。当我们把这些数据发送到
- 无意中看到一段用Tkinter库写的放烟花的程序,就跟着跑了一遍。设计理念:通过让画面上一个粒子分裂为X数量的粒子来模拟 * 效果。粒子会发生
- 越来越多的网站在logo中添加叶子元素,而此类logo又常常使用绿色,这可以给人希望、清新、健康的感觉,从而很容易被接受和认可。今天我们又收
- 一、开发环境集成开发工具:jupyter notebook 6.5.2集成开发环境:Python 3.10.6第三方库:tensorflow
- MySQL是一个非常流行的小型关 系型数据库管理系统,2008年1月16号被Sun公司收购。目前MySQL被广泛地应用在Internet上的
- 问题描述最近做一个项目,是用Python进行相关的串口操作。及将相关指令通过串口发给设备,设备根据发过来的指令来做出相应的操作,所用的库是P
- <% '#######以下是一个类文件,下面的注解是调用类的方法#########################
- 为了庆祝自己的博客重新开放,我在这里放一个自己刚刚写的jquery日期插件, 也许人们会说:日期选取插件已
- 相信在使用MSSQL数据库下使用事务回滚方式操作多表记录的时候,会经常出现“不能在手动或分布事务方式下创建新的连接”的出错提示信息,这个问题
- 计算机键盘每天用得太多了,以致于我们无视它的存在(盲打),当然也很少有人去问这样一个问题——为什么键盘字母的排列方式是QWERTY而不是AB
- 本文实例讲述了JS实现仿Windows经典风格的选项卡Tab切换代码。分享给大家供大家参考,具体如下:这款仿Windows风格的选项卡,带有
- 前言随着网站的内容的增多和用户访问量的增多,网站加载会越来越慢,受限于带宽和服务器同一时间的请求次数的限制,,我们往往需要在此时对我们的网站
- sklearn的cross_validation包中含有将数据集按照一定的比例,随机划分为训练集和测试集的函数train_test_spli
- 目录wsgi 相关概念CGIWSGIASGIcgi 示例cgi脚本cgi服务实现wsgirefwsgi 小结小技巧python web开发中
- 前言python2.x版本的字符编码有时让人很头疼,遇到问题,网上方法可以解决错误,但对原理还是一知半解,本文主要介绍 python 中字符