<s> from environment . cloud . compute import cleanup_cloud_compute <EOL> from environment . cloud . compute import create_cloud_compute <EOL> from environment . cloud . network import setup_cloud_network <EOL> from environment . cloud . storage import create_cloud_storage <EOL> from environment . config . sysconfig import apply_default_configuration <EOL> from environment . infrastructure . compute import cleanup_infrastructure_compute <EOL> from environment . infrastructure . compute import create_infrastructure_compute <EOL> from environment . infrastructure . network import create_infrastructure_network <EOL> from environment . infrastructure . storage import create_infrastructure_storage <EOL> from environment . users . tenants import cleanup_default_tenants <EOL> from environment . users . tenants import create_default_tenants <EOL> from kahuna . abstract import AbsPlugin <EOL> from kahuna . config import ConfigLoader <EOL> from org . jclouds . abiquo . domain . exception import AbiquoException <EOL> from org . jclouds . rest import AuthorizationException <EOL> class EnvironmentPlugin ( AbsPlugin ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . __config = ConfigLoader ( ) . load ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> def create ( self , args ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> apply_default_configuration ( self . __config , self . _context ) <EOL> dc = create_infrastructure_compute ( self . __config , self . _context ) <EOL> create_infrastructure_storage ( self . __config , self . _context , dc ) <EOL> create_infrastructure_network ( self . __config , self . _context , dc ) <EOL> create_default_tenants ( self . __config , self . _context , dc ) <EOL> vdc = create_cloud_compute ( self . __config , self . _context , dc ) <EOL> create_cloud_storage ( self . __config , self . _context , vdc ) <EOL> setup_cloud_network ( self . __config , self . _context , vdc ) <EOL> except ( AbiquoException , AuthorizationException ) , ex : <EOL> print "<STR_LIT>" % ex . getMessage ( ) <EOL> def clean ( self , args ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> cleanup_cloud_compute ( self . __config , self . _context ) <EOL> cleanup_default_tenants ( self . __config , self . _context ) <EOL> cleanup_infrastructure_compute ( self . __config , self . _context ) <EOL> except ( AbiquoException , AuthorizationException ) , ex : <EOL> print "<STR_LIT>" % ex . getMessage ( ) <EOL> def load ( ) : <EOL> """<STR_LIT>""" <EOL> return EnvironmentPlugin ( ) </s>
