当前位置: 首页 > 编程笔记 >

启动targetcli时遇到错误解决办法

益承颜
2023-03-14
本文向大家介绍启动targetcli时遇到错误解决办法,包括了启动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 

如有疑问,请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

 类似资料:
  • 本文向大家介绍Android webview 遇到android.os.FileUriExposedException错误解决办法,包括了Android webview 遇到android.os.FileUriExposedException错误解决办法的使用技巧和注意事项,需要的朋友参考一下 Android webview 遇到android.os.FileUriExposedException

  • 本文向大家介绍IOS json 解析遇到错误问题解决办法,包括了IOS json 解析遇到错误问题解决办法的使用技巧和注意事项,需要的朋友参考一下 概要: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn't be completed. (Cocoa error 3840.)" (Unescaped control ch

  • 换电脑后好几个项目都这样,百度过一些方法都不行,有人知道如何处理吗,谢谢

  • 在启动时获取错误:“虚拟框无法启动虚拟设备。要找出问题的原因,请从虚拟框启动虚拟设备。有关详细信息,请查找日志文件。" 当我在VirtualBox上启动API时,得到错误消息:“虚拟机'Google Nexus 5-6.0.0-API 23-1080x1920'在启动过程中意外终止,退出代码为1(0x1)。有关详细信息,请参阅'C:\Users\Mavara\AppData\Local\Genym

  • 本文向大家介绍MySQL启动错误解决方法,包括了MySQL启动错误解决方法的使用技巧和注意事项,需要的朋友参考一下 一般情况下mysql的启动错误还是很容易排查的,但是今天我们就来说一下不一般的情况。拿到一台服务器,安装完mysql后进行启动,启动错误如下: 有同学会说,哥们儿你是不是buffer pool设置太大了,设置了96G内存。这明显提示无法分配内存嘛。如果真是这样也就不在这里进行分享了,

  • 本文向大家介绍Android getBackground().setAlpha遇到问题解决办法,包括了Android getBackground().setAlpha遇到问题解决办法的使用技巧和注意事项,需要的朋友参考一下 Android getBackground().setAlpha遇到问题解决办法 前言: 使用getBackground().setAlpha,导致其他布局背景透明度都改变的问