本文整理匯總了Python中dockertest.dockercmd.NoFailDockerCmd.subargs方法的典型用法代碼示例。如果您正苦於以下問題:Python NoFailDockerCmd.subargs方法的具體用法?Python NoFailDockerCmd.subargs怎麽用?Python NoFailDockerCmd.subargs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dockertest.dockercmd.NoFailDockerCmd
的用法示例。
在下文中一共展示了NoFailDockerCmd.subargs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run_once
# 需要導入模塊: from dockertest.dockercmd import NoFailDockerCmd [as 別名]
# 或者: from dockertest.dockercmd.NoFailDockerCmd import subargs [as 別名]
def run_once(self):
super(every_last, self).run_once()
total = len(self.sub_stuff['lastfiles'])
self.sub_stuff['expected_total'] = total
self.loginfo("Testing copy of %d files from container" % total)
self.sub_stuff['results'] = {} # cont_path -> cmdresult
# Avoid excessive logging
nfdc = NoFailDockerCmd(self, 'cp', verbose=False)
nfdc.quiet = True
nfiles = 0
for index, srcfile in enumerate(self.sub_stuff['lastfiles']):
if index % 100 == 0:
self.loginfo("Copied %d of %d", index, total)
cont_path = "%s:%s" % (self.sub_stuff['container_name'], srcfile)
host_path = self.tmpdir
host_fullpath = os.path.join(host_path, os.path.basename(srcfile))
nfdc.subargs = [cont_path, host_path]
nfdc.execute()
self.failif(not os.path.isfile(host_fullpath),
"Not a file: '%s'" % host_fullpath)
nfiles += 1
if nfiles >= self.config['max_files']:
break