for 루프에서 key : value 쌍을 사용하는 스크립트를 수정하려고합니다. 나는 for 루프가 단지 1 대신 key에 3 개의 값을 취할 수 있도록 변경해야한다. 미리 감사드립니다. for 루프에서 키 값을 여러 개 사용
for fileName,readPct,readhPct,writehPct in hpct_file_list.items():
...
ValueError: need more than 2 values to unpack
여기 코드입니다
: :이 오류 얻을hpct_file_list = {'rhpct_50_80_20_tier2': ['80', '50', '0'], 'whpct_50_20_80_tier2': ['20', '0', '50']}
for fileName,readPct,readhPct,writehPct in hpct_file_list.items():
hostRoot.VmExec("cd C:\\Program Files (x86)\\vdbench")
VmCommon.LogMsg('Creating File : %s '%(fileName))
hostRoot.VmExec("echo validate=yes > %s"%(fileName))
hostRoot.VmExec("echo sd=sda, lun=%s, threads=16, hitarea=25m, size=875G >> %s" %(device_name, fileName))
hostRoot.VmExec("echo wd=wd1, sd=sda, xfersize=512, rdpct=%s, rhpct=%s, whpct=%s, seekpct=random >> %s" % (readPct, readhPct, writehPct, fileName))
hostRoot.VmExec("echo wd=wd2, sd=sda, xfersize=1k, rdpct=%s, rhpct=%s, whpct=%s, seekpct=random >> %s" % (readPct, readhPct, writehPct, fileName))