def image_is_present_only_in_node(context, image_name, region_name): """Check that the image is only present in the given node""" for region in context.glance_manager_list: if region != context.master_region_name: if region == region_name: image_is_present_in_nodes(context, region, image_name) else: image_is_not_present_in_node(context, region, image_name)
def image_is_not_present_in_nodes(context, image_name): """Check that the image is not present in all target nodes""" for region in context.glance_manager_list: if region != context.master_region_name: image_is_not_present_in_node(context, region, image_name)