Exemplo n.º 1
0
 def tearDown(self):
     if self.instance is not None:
         common_functions.delete_instance(self.nova, self.instance.id)
     if self.image is not None:
         common_functions.delete_image(self.glance, self.image.id)
     if self.our_own_flavor_was_created:
         common_functions.delete_flavor(self.nova, self.expected_flavor_id)
     # delete the floating ip
     self.nova.floating_ips.delete(self.floating_ip)
     # delete the security group
     self.nova.security_group_rules.delete(self.icmp_rule)
     self.nova.security_group_rules.delete(self.tcp_rule)
     self.nova.security_groups.delete(self.the_security_group.id)
     # delete security rules from the 'default' group
     self.nova.security_group_rules.delete(self.icmp_rule_default)
     self.nova.security_group_rules.delete(self.tcp_rule_default)
     self.assertEqual(self.amount_of_images_before,
                      len(list(self.glance.images.list())),
                      "Length of list with images should be the same")
Exemplo n.º 2
0
def delete_cirros_image(os_conn):
    """Delete the cirros image"""
    logger.info("Delete the cirros image")
    image = os_conn._get_cirros_image()
    common.delete_image(os_conn.glance, image.id)