本文整理汇总了Python中dockertest.images.DockerImages.gen_lower_only方法的典型用法代码示例。如果您正苦于以下问题:Python DockerImages.gen_lower_only方法的具体用法?Python DockerImages.gen_lower_only怎么用?Python DockerImages.gen_lower_only使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dockertest.images.DockerImages
的用法示例。
在下文中一共展示了DockerImages.gen_lower_only方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import gen_lower_only [as 别名]
def initialize(self):
super(tag_base, self).initialize()
config.none_if_empty(self.config)
di = DockerImages(self.parent_subtest)
di.gen_lower_only = self.config['gen_lower_only']
name_prefix = self.config["tag_repo_name_prefix"]
new_img_name = di.get_unique_name(name_prefix)
while self.check_image_exists(new_img_name):
new_img_name = "%s_%s" % (name_prefix,
utils.generate_random_string(8))
self.sub_stuff["image"] = new_img_name
base_image = DockerImage.full_name_from_defaults(self.config)
prep_changes = DockerCmd(self.parent_subtest, "tag",
[base_image,
self.sub_stuff["image"]],
self.config['docker_tag_timeout'])
results = prep_changes.execute()
if results.exit_status:
raise xceptions.DockerTestNAError("Problems during "
"initialization of"
" test: %s", results)
im = self.check_image_exists(self.sub_stuff["image"])
self.sub_stuff['image_list'] = im
示例2: initialize
# 需要导入模块: from dockertest.images import DockerImages [as 别名]
# 或者: from dockertest.images.DockerImages import gen_lower_only [as 别名]
def initialize(self):
super(tag_base, self).initialize()
config.none_if_empty(self.config)
di = DockerImages(self.parent_subtest)
di.gen_lower_only = self.config['gen_lower_only']
name_prefix = self.config["tag_repo_name_prefix"]
new_img_name = di.get_unique_name(name_prefix)
while self.check_image_exists(new_img_name):
new_img_name = "%s_%s" % (name_prefix,
utils.generate_random_string(8))
if self.config['gen_lower_only']:
new_img_name = new_img_name.lower()
else:
new_img_name += '_UP' # guarantee some upper-case
self.sub_stuff["image"] = new_img_name
base_image = DockerImage.full_name_from_defaults(self.config)
self.prep_image(base_image)