當前位置: 首頁>>代碼示例>>Python>>正文


Python NoFailDockerCmd.subargs方法代碼示例

本文整理匯總了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
開發者ID:ldoktor,項目名稱:autotest-docker,代碼行數:25,代碼來源:cp.py


注:本文中的dockertest.dockercmd.NoFailDockerCmd.subargs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。