<s> from rally import consts <EOL> from rally . plugins . openstack import scenario <EOL> from rally . plugins . openstack . scenarios . glance import utils <EOL> from rally . plugins . openstack . scenarios . nova import utils as nova_utils <EOL> from rally . task import types <EOL> from rally . task import validation <EOL> class GlanceImages ( utils . GlanceScenario , nova_utils . NovaScenario ) : <EOL> """<STR_LIT>""" <EOL> @ types . convert ( image_location = { "<STR_LIT:type>" : "<STR_LIT>" } ) <EOL> @ validation . required_services ( consts . Service . GLANCE ) <EOL> @ validation . required_openstack ( users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def create_and_list_image ( self , container_format , <EOL> image_location , disk_format , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . _create_image ( container_format , <EOL> image_location , <EOL> disk_format , <EOL> ** kwargs ) <EOL> self . _list_images ( ) <EOL> @ validation . required_services ( consts . Service . GLANCE ) <EOL> @ validation . required_openstack ( users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def list_images ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _list_images ( ) <EOL> @ validation . required_services ( consts . Service . GLANCE ) <EOL> @ validation . required_openstack ( users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def create_and_delete_image ( self , container_format , <EOL> image_location , disk_format , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> image = self . _create_image ( container_format , <EOL> image_location , <EOL> disk_format , <EOL> ** kwargs ) <EOL> self . _delete_image ( image ) <EOL> @ types . convert ( flavor = { "<STR_LIT:type>" : "<STR_LIT>" } ) <EOL> @ validation . flavor_exists ( "<STR_LIT>" ) <EOL> @ validation . required_services ( consts . Service . GLANCE , consts . Service . NOVA ) <EOL> @ validation . required_openstack ( users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" , "<STR_LIT>" ] } ) <EOL> def create_image_and_boot_instances ( self , container_format , <EOL> image_location , disk_format , <EOL> flavor , number_instances , <EOL> ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> image = self . _create_image ( container_format , <EOL> image_location , <EOL> disk_format ) <EOL> image_id = image . id <EOL> self . _boot_servers ( image_id , flavor , number_instances , ** kwargs ) </s>
