启动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


猜你喜欢
- 本文实例讲述了python3 常见解密加密算法。分享给大家供大家参考,具体如下:一.使用base64Base64编码,64指A-Z、a-z、
- 安装pyinstallpip install pyinstaller注意事项除非必要,否则尽量不要直接import module,用from
- ORDER BY _column1, _column2; /* _column1升序,_column2升序 */ ORDER BY _col
- Content Design(内容设计)即涉及产品需求也涉及到(产品和用户)互动过程中的具体环节。大多数团队中只有PM才会涉及到相关工作,一
- 最近尝试把项目迁移到Python环境下,特别新装了一台干净的Debian系统,准备重新配置环境,上网找了一些运行Python Web的环境方
- 什么是反射在Python中,反射是指通过一组内置的函数和语句,在运行时动态地访问、检查和修改对象的属性、方法和类信息的机制。Python中的
- Fibonacci斐波那契数列,很简单,就是一个递归嘛,学任何编程语言可能都会做一下这个。最近在玩Python,在粗略的看了一下Learni
- 在用Pygame写游戏的时候,有人可能会遇到两个Rect对象碰撞但是对象之间还有空间间隔的问题,这里,将教大家用一种方法精准地检测图像碰撞。
- 近段时间由于修改一个ASP程序(有SQL注入漏洞),在网上找了很多相关的一些防范办法,都不近人意,所以我将现在网上的一些方法综合改良了一下,
- 项目地址:https://github.com/GriffinLewis2001/Python_movie_links_scraper运行效
- 一、全局阈值原图:整幅图采用一个阈值,与图片的每一个像素灰度进行比较,重新赋值;1.效果图2.源码import cv2import matp
- 前言最近很多新入职的同事问这个问题,特别是通过 homebrew 自动安装的 mysql ,其版本默认已经是 8.0 了,由于增加了一些安全
- 1、安装AnacondaAnaconda指的是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。
- 背景一直以来,中式占卜都是基于算命先生手工实现,程序繁琐(往往需要沐浴、计算天时、静心等等流程)。准备工作复杂(通常需要铜钱等道具),计算方
- 自学Django已经有一周啦,想把自己自学过程中的每一步都记录下来,给一些零基自学Django的战友们一些参考;本次主要内容为,用一个实例展
- 3.0迟迟没有发布release版本,现阶段在Vue项目中使用Typescript需要花不小的精力在工程的配置上面。主要的工作是webpac
- 我们要生成二维码都需要借助一些类库来实现了,下面我介绍利用PHP QR Code生成二维码吧,生成方法很简单,下面我来介绍一下.利用php类
- Swagger是一个API开发者的工具框架,用于生成、描述、调用和可视化RESTful风格的Web服务。总体目标是使客户端和文件系统服务器以
- sympy版本:1.2假设求解矩阵方程AX=A+2X其中求解之前对矩阵方程化简为(A−2E)X=A令B=(A−2E)使用qtconsole输
- 写在前面vue中关于插槽的文档说明很短,语言又写的很凝练,再加上其和methods,data,computed等常用选项使用频率、使用先后上