本文整理匯總了Python中pyscsi.pyscsi.scsi.SCSI.reportpriority方法的典型用法代碼示例。如果您正苦於以下問題:Python SCSI.reportpriority方法的具體用法?Python SCSI.reportpriority怎麽用?Python SCSI.reportpriority使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyscsi.pyscsi.scsi.SCSI
的用法示例。
在下文中一共展示了SCSI.reportpriority方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from pyscsi.pyscsi.scsi import SCSI [as 別名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import reportpriority [as 別名]
def main(device):
try:
sd = SCSIDevice(device)
s = SCSI(sd)
s.testunitready()
except Exception as e:
print (e)
else:
print ('ReportPriority')
print ('==========================================\n')
try:
r = s.reportpriority().result
for k, v in r.iteritems():
print('%s - %s' % (k, v))
except Exception as e:
print (e)
示例2: main
# 需要導入模塊: from pyscsi.pyscsi.scsi import SCSI [as 別名]
# 或者: from pyscsi.pyscsi.scsi.SCSI import reportpriority [as 別名]
def main():
dev = MockReportPriority()
dev.opcodes = spc
s = SCSI(dev)
s.device.opcodes = spc
r = s.reportpriority(priority=0x00, alloclen=1112527)
cdb = r.cdb
assert cdb[0] == s.device.opcodes.SPC_OPCODE_A3.value
assert cdb[1] == s.device.opcodes.SPC_OPCODE_A3.serviceaction.REPORT_PRIORITY
assert cdb[2] == 0
assert scsi_ba_to_int(cdb[6:10]) == 1112527
assert cdb[10:12] == bytearray(2)
cdb = r.unmarshall_cdb(cdb)
assert cdb['opcode'] == s.device.opcodes.SPC_OPCODE_A3.value
assert cdb['service_action'] == s.device.opcodes.SPC_OPCODE_A3.serviceaction.REPORT_PRIORITY
assert cdb['priority_reported'] == 0
assert cdb['alloc_len'] == 1112527
d = ReportPriority.unmarshall_cdb(ReportPriority.marshall_cdb(cdb))
assert d == cdb