我使用Python远程运行一个命令,这是我得到的输出:Vserver Volume Aggregate State Type Size Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
vs_cfm06 Available aggr_backup_1 online RW 100GB 66.37GB 33%
vs_cfm06 Discovery aggr_backup_1 online RW 100GB 66.36GB 33%
vs_cfm06 NonDebugCF01 aggr_backup_1 online RW 100GB 64.63GB 35%
vs_cfm06 NonDebugCF01_BACKUP aggr_backup_1 online RW 5GB 4.75GB 5%
vs_cfm06 Software aggr_backup_1 online RW 100GB 65.08GB 34%
vs_cfm06 Template aggr_backup_1 online RW 100GB 66.35GB 33%
vs_cfm06 breakresetafterfaildelCF01 aggr_backup_1 online RW 100GB 69.52GB 30%
vs_cfm06 breakresetafterfaildelCF01_BACKUP aggr_backup_1 online RW 5GB 4.75GB 5%
vs_cfm06 rootvol aggr_backup_1 online RW 1GB 972.5MB 5%
vs_cfm06 vol aggr_backup_1 online RW 1GB 972.6MB 5%
10 entries were displayed.
如何从中提取一列,以便输出如下:Available
Discovery
NonDebugCF01
NonDebugCF01_BACKUP
Software
Template
breakresetafterfaildelCF01
breakresetafterfaildelCF01_BACKUP
rootvol
vol
运行命令并打印输出的代码如下:def get_volumes(usrname, ip):
raw_output = ru.run('volume show', user=usrname, host=ip, set_e=False) //logs onto netapp and runs command
print raw_output
当我运行print type(raw_output)时,它说它是unicode。
任何帮助都将不胜感激。