<s> from rally import consts <EOL> from rally . plugins . openstack import scenario <EOL> from rally . plugins . openstack . scenarios . quotas import utils <EOL> from rally . task import validation <EOL> class Quotas ( utils . QuotasScenario ) : <EOL> """<STR_LIT>""" <EOL> @ validation . required_services ( consts . Service . NOVA ) <EOL> @ validation . required_openstack ( admin = True , users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def nova_update ( self , max_quota = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> self . _update_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] , <EOL> max_quota ) <EOL> @ validation . required_services ( consts . Service . NOVA ) <EOL> @ validation . required_openstack ( admin = True , users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def nova_update_and_delete ( self , max_quota = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> self . _update_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] , <EOL> max_quota ) <EOL> self . _delete_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] ) <EOL> @ validation . required_services ( consts . Service . CINDER ) <EOL> @ validation . required_openstack ( admin = True , users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def cinder_update ( self , max_quota = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> self . _update_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] , <EOL> max_quota ) <EOL> @ validation . required_services ( consts . Service . CINDER ) <EOL> @ validation . required_openstack ( admin = True , users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def cinder_update_and_delete ( self , max_quota = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> self . _update_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] , <EOL> max_quota ) <EOL> self . _delete_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] ) <EOL> @ validation . required_services ( consts . Service . NEUTRON ) <EOL> @ validation . required_openstack ( admin = True , users = True ) <EOL> @ scenario . configure ( context = { "<STR_LIT>" : [ "<STR_LIT>" ] } ) <EOL> def neutron_update ( self , max_quota = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> quota_update_fn = self . admin_clients ( "<STR_LIT>" ) . update_quota <EOL> self . _update_quotas ( "<STR_LIT>" , self . context [ "<STR_LIT>" ] [ "<STR_LIT:id>" ] , <EOL> max_quota , quota_update_fn ) </s>
