#NEWLINE# def __init__( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# super ( CreateServiceChainInstanceForm , self ) . __init__ ( ptgs , * args , ** kwargs ) #NEWLINE# try : #NEWLINE# #INDENT# sc_specs = client . servicechainspec_list ( request , tenant_id = request . user . tenant_id ) #NEWLINE# ptgs = client . policy_target_list ( request , tenant_id = request . user . tenant_id ) #NEWLINE# ptgs = [ ( item . id , item . name ) for item in ptgs ] #NEWLINE# classifiers = client . policyclassifier_list ( request , tenant_id = request . user . tenant_id ) #NEWLINE# self . fields [ 'servicechain_spec' ] . choices = [ ( item . id , item . name ) for item in sc_specs ] #NEWLINE# self . fields [ 'provider_ptg' ] . choices = ptgs #NEWLINE# self . fields [ 'consumer_ptg' ] . choices = ptgs #NEWLINE# self . fields [ 'classifier' ] . choices = [ ( item . id , item . name ) for item in classifiers ] #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# msg = _ ( 'Failed to retrive policy targets' ) #NEWLINE# LOG . error ( msg )